您的位置:首页 > Web前端 > CSS

通过iframe引入另外一个项目中的html片段到项目中,解决样式,高度,兼容等问题的策略

2015-06-26 10:57 1096 查看
<!--尾部开始-->
<iframe src="http://172.16.24.11:9000/cartoon-web/footer_new"
marginheight="0" marginwidth="0" frameborder="0" scrolling="no"
width='100%' height='392' id="iframepage" name="iframepage" onLoad="iFrameHeight()" ></iframe>

<!--尾部结束-->
<script language="javascript" type="text/javascript" charset="utf-8" src="js/jquery-2.1.1.js"></script>
<script language="javascript" type="text/javascript" charset="utf-8">
$(function(){
$(".wj_content form table tbody tr td.title").each(function(index,domEle){
$(this).text((index+1) + "、" +$(this).text());
});
});

function iFrameHeight() {
var ifm= document.getElementById("iframepage");
var subWeb = document.frames ? document.frames["iframepage"].document :ifm.contentDocument;
if(ifm != null && subWeb != null) {ifm.height = subWeb.body.scrollHeight;}
}
</script>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: