日期:2014-05-17  浏览次数:20425 次

滚动条的问题?
 
  就是在一个页面中,我用了母版页,然后用了iframe,但是当我给iframe滚动条设置高度时,为什么页面的body和iframe都出现的滚动条,我用 样式 overflow:hidden; 也没有去掉body的滚动条,各位帮忙解决解决阿!


------解决方案--------------------
把iframe标签的 scrolling属性设为No试试
------解决方案--------------------
HTML code

 <iframe id="mainFrame" frameborder="0" height="100%;" marginheight="0" marginwidth="0"
                    name="mainFrame" src="<% = MainURL %>" width="100%"></iframe>

------解决方案--------------------
HTML code

 <iframe id="mainFrame" frameborder="0" height="100%;" marginheight="0" marginwidth="0"
                    name="mainFrame" src="<% = MainURL %>" width="100%"></iframe>

------解决方案--------------------
//js实现div自适应高度
$(window).bind("load", _setMenuHeight);
$(window).bind("resize", _setMenuHeight);
var leftHeigthFirst = $("#left").height();

function _setMenuHeight() {
if (leftHeigthFirst < $("#right").height()) {
$("#left").height($("#right").height());
$("#middle").height($("#left").height());
}
else {
$("#right").height($("#left").height());
$("#middle").height($("#right").height());
}
$("#body").attr("scroll", "yes");
}
</script>
通过JS可以自适应高度来解决。