jq 对iframe 标签动态调整高度

个人认为最优解: 

//iframe 页面加载完成后执行 
$("#tabIframe").load(function() {
            setTimeout(function(){
                //获取iframe 页面中的#content-body 内容高度
                var h = $("#tabIframe").contents().find("#content-body").height();
            	$("#tabIframe").height(h + 100);
            },300);
        }); 

猜你喜欢

转载自blog.csdn.net/LookingTomorrow/article/details/123050381
今日推荐