I\'m developing with jquery and I stumbled with the next problem: I added an IFrame inside the main page and I want to re size them from inside. I tried some ideas but witho
When you create an IFRAME
the browser automatically adds a 'window'
object for the IFRAME inside the 'window'
object of main page.
You need to change the size of the IFRAME
instead of the size of the document.
Try this code:
For JavaScript
:
window.parent.document.getElementById('myframe').width = '500px';
window.parent.document.getElementById('myframe').height = '500px';
And for jQuery
:
$('#myframe', window.parent.document).width('500px');
$('#myframe', window.parent.document).height('500px');