function reloadFrameHeightShow(){
var height = $("#mainContent7").contents().find("#wrap").height();
$("#mainContent7").height(height);
window.parent.reloadFrameHeight();
}
千万不要写load
xxxxxxxx
function reloadFrameHeight(){
$("#mainContent7").load(function(){
var height = $(this).contents().find("body").height();
$(this).height(height);
window.parent.reloadFrameHeight();
})
}
xxxxxxxx
最近项目的一个iframe的使用
父页面写
function reloadFrameHeight(){
$("#myEmailIframe").load(function(){
var height = $(this).contents().height();
$(this).height(height);
})
}
子页面在加载完内容后调用父页面的reloFrameHeight()方法
window.parent.reloadFrameHeight();
-----------------------------------------------------
但是不支持firefox火狐浏览器,断章取义的,说明一下是因为 火狐浏览器不能在往页面注入内容后 获取页面的高度,必须是页面加载完毕之后才能获取内容高度。
支持firefox的方法
父页面写
$(fucntion(){
setTimeout('reloadFrameheight()',3000);
})
fucntion reloadFrameHeight(){
var height=$("#myEmailIframe").contents().find('body').height();
$("myEmailIframe").height(height);
}
子页面不需要写任何东西
-----------------------------------------------------
.hddc_xz a{} 控制class后面的a标签
<td class="hddc_xz" id="class" ><a href="training_course_announcement_main.jsp?class_info_id=<%=request.getParameter("class_info_id")%>" target="main" id="0" οnclick="changeStyle(this,'class');">班级信息</a></td>