samtiger


          QQ:418148757
          Name:yangchuan
          數(shù)據(jù)加載中……
          iframe自適應(yīng)高度

          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 閱讀(237) 評論(0)  編輯  收藏


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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 屏边| 五指山市| 措美县| 岐山县| 安平县| 长垣县| 张家港市| 博爱县| 丹东市| 彰武县| 科技| 义马市| 喀喇沁旗| 日喀则市| 高淳县| 龙州县| 鸡西市| 鄱阳县| 甘肃省| 历史| 鹤峰县| 甘德县| 盖州市| 射阳县| 武夷山市| 崇州市| 天全县| 稻城县| 紫云| 祥云县| 石阡县| 祁阳县| 沙洋县| 固始县| 铜鼓县| 禄劝| 牟定县| 枞阳县| 伊通| 水城县| 兴化市|