我有一个页眉和页脚div高度设置为100 of的页面,并且我做了一个简单的jquery函数,使中心元素在浏览器调整大小时改变其高度,这样页面总是100%的视口高。
//resize
function resize_scroll_pane() {
var dynamic_height = $(window).height() - ($(".navbar").outerHeight() + $(".footer").outerHeight());
$(".scroll-pane, .items, .items img").css("height",dynamic_height + "px");
}
$(document).ready(function() {
resize_scroll_pane();
$(window).bind('resize', resize_scroll_pane);
});除了在IE8之外,它在所有浏览器中都很有魅力。有人能帮我找出原因吗?我使用的jQuery1.11.1应该是IE8兼容的,我还包括了html5shiv.min.js和respond.min.js来扩展IE8的功能。
发布于 2014-10-09 12:13:18
$(window).scroll(resize_scroll_pane);
$(window).resize(resize_scroll_pane);你可以同时使用它们。它在IE8为我工作。
https://stackoverflow.com/questions/26278000
复制相似问题