samtiger


          QQ:418148757
          Name:yangchuan
          數據加載中……
          iframe自適應高度

          Ext.onReady(function() {

           function reinitIframe(){
            var iframe = document.getElementById("frame_content");
            try{
             var bHeight = iframe.contentWindow.document.body.scrollHeight;
            }catch (ex){
               var bHeight = 0;
            } 
            try{
             var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
            }catch (ex){
                var dHeight = 0;
            }
            if(dHeight!=0 && bHeight!=0){
             var height = Math.min(bHeight, dHeight);
            }else{
             var height = Math.max(bHeight, dHeight);
            }
            if(Ext.isGecko){
             height = height+30;
            }
            iframe.style.height =  height+"px";
           }
           window.setInterval(function(){
            reinitIframe()
           }, 200);
          });

          posted on 2010-10-21 09:56 sam.chuan.yang 閱讀(238) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 昌江| 普兰店市| 平安县| 玉屏| 常宁市| 彭州市| 湖州市| 淮滨县| 金溪县| 老河口市| 襄城县| 姚安县| 东丽区| 双峰县| 灵寿县| 信宜市| 定兴县| 永善县| 沾益县| 闸北区| 社会| 海南省| 罗城| 岱山县| 卢氏县| 松潘县| 南郑县| 冀州市| 孝感市| 察隅县| 富顺县| 马龙县| 荔浦县| 丹江口市| 宁乡县| 岱山县| 清苑县| 聂荣县| 绥棱县| 察哈| 祁阳县|