jQuery简单实现iframe的高度根据页面内容自适应的方法
同域下:
//注意:下面的代码是放在和iframe同一个页面中调用
$("#myiframe").load(function () {
var myiframeH = $(this).contents().find("body").height() + 30;
$(this).height(myiframeH);
console.log("a---" + myiframeH);
});

浙公网安备 33010602011771号