function iframeLoaded() {
var iFrameID = document.getElementById('iframe_login');
if (iFrameID) {
// here you can meke the height, I delete it first, then I make it again
iFrameID.height = "";
iFrameID.height = iFrameID.contentWindow.document.body.scrollHeight + "px";
}
}
此脚本不适用于 Mozilla firefox,但适用于 chrome。
最佳答案
使用 jquery,http://api.jquery.com/height/
function iframeLoaded() {
var iFrameID = $('#iframe_login');
if (iFrameID) {
iFrameID.height(...)
}
}
关于javascript - Asp.net 使用 JavaScript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16054084/