God9ps Posted August 7, 2015 at 07:34 PM Report #586823 Posted August 7, 2015 at 07:34 PM Estou com um problemazito, preciso ajustar o tamanho de um iframe consoante o tamanho da pagina a carregar dentro dele. O problema é que a função que estou a utilizar vai captar sempre o tamanho do scroll da página top e não a que foi carregada dentro do iframe. O meu codigo: <script> function adjustIframe(obj) { document.getElementById(obj).height = document.documentElement.scrollHeight; } </script> <body> <iframe name="ifrm" id="ifrm" src="" width="798px" scrolling="no" onload="javascript:adjustIframe('ifrm');"></iframe> </body>
God9ps Posted August 7, 2015 at 08:14 PM Author Report #586827 Posted August 7, 2015 at 08:14 PM resolvido... document.getElementById(obj).height = [b]parent.frames[obj][/b].document.documentElement.scrollHeight;
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now