正是标题所说的!我创建的粘性页脚插件(来自您所有优秀人物的一些慷慨援助)运行良好,但它不断创建这种奇怪的infini滚动效果。粘滞页脚创建无限滚动
不知道这里发生了什么?我很难过,尽管我怀疑jQuery中有些东西我没有足够的知识来解决。
感谢您提供任何帮助!
的Javascript:
jQuery(document).ready(function($){
$(window).bind("load", function() {
var footerHeight = 0, footerTop = 0, $footer = $("#footer");
positionFooter();
function positionFooter() {
footerHeight = $footer.height();
footerTop = ($(window).scrollTop()+$(window).height()-footerHeight)+"px";
if(($(document.body).height()+footerHeight) < $(window).height()) {
$footer.css({ position: "absolute"}).animate({ top: footerTop },-1)
} else {
$footer.css({ position: "static"})
}
}
$(window).scroll(positionFooter).resize(positionFooter)
});
});
CSS:
#footer {
clear: both;
height: 80px;
padding: 0 0;
background: #315B71;
border-top: 8px solid rgb(29, 71, 93);
width: 100%;
}
这里的显示问题小提琴:http://jsfiddle.net/ZxupR/
我在Safari上看不到任何滚动问题? –