Jquery 操作页面中iframe自动跟随窗口大小变化,而不出现滚动条,只在iframe内部出滚动条
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<script src="js/jquery-1.4.1.js" type="text/javascript"></script>
<script type="text/javascript">
var pagestyle = function() {
var rframe = $("#mainFrame");
//ie7默认情况下会有上下滚动条,去掉上下15像素
var h = $(window).height() - rframe.offset().top - 15;
rframe.height(h);
}
//注册加载事件
$("#mainFrame").load(pagestyle);
//注册窗体改变大小事件
$(window).resize(pagestyle);
</script>
<style type="text/css">
#ifrRow
{
margin-bottom: 252px;
}
</style>
</head>
<body>
<form ></iframe>
</div>
</form>
</body>
</html>