简体   繁体   English

使用JavaScript的Asp.net

[英]Asp.net Using JavaScript

    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";
        }
    }

This script is not working in Mozilla firefox but it works in chrome. 该脚本在Mozilla firefox中不起作用,但在chrome中起作用。

use jquery, http://api.jquery.com/height/ 使用jquery, http://api.jquery.com/height/

 function iframeLoaded() {
        var iFrameID = $('#iframe_login');
        if (iFrameID) {
            iFrameID.height(...)
        }
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM