您的位置:首页 > 其它

使用iframe自适应宽度和高度

2015-06-30 15:42 288 查看
核心:使用jQuery技术

宽度:
$("#mainContent").css('width',$(window).width());
高度:onload="$(this).height($(this).contents().height())"<iframe id="mainContent" scrolling="auto" name="mainContent" onload="$(this).height($(this).contents().height())" src="a.html" frameborder="0"/>


宽度和高度分别设置,百分百兼容
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: