Created
July 24, 2012 06:20
-
-
Save riix/3168353 to your computer and use it in GitHub Desktop.
IFRAME
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// IFRAME 개체 셀렉트 sample - iframe ID | |
$('#Form_Body',window.frames["sample"].window.document); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// put on the page that calls the iframe | |
$(function () { | |
var iFrames = $('iframe'); | |
function iResize() { | |
for (var i = 0, j = iFrames.length; i < j; i++) { | |
iFrames[i].style.height = iFrames[i].contentWindow.document.body.offsetHeight + 'px'; | |
} | |
} | |
if ($.browser.safari || $.browser.opera) { | |
iFrames.load(function () { | |
setTimeout(iResize, 0); | |
}); | |
for (var i = 0, j = iFrames.length; i < j; i++) { | |
var iSource = iFrames[i].src; | |
iFrames[i].src = ''; | |
iFrames[i].src = iSource; | |
} | |
} else { | |
iFrames.load(function () { | |
this.style.height = this.contentWindow.document.body.offsetHeight + 'px'; | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment