I'm using this code but in Internet Explorer causes the header which follows the page scroll to act very jittery. Anyone know what problem could be?
var name = "#header";
var menuYloc = 'null';
menuYloc = parseInt($(name).css("top").substring(0,$(name).css("top").indexOf("px")))
$(window).scroll(function () {
var offset = menuYloc+$(window).scrollTop()+"px";
alert(offset);
$(name).animate({'top':开发者_高级运维offset},500);
});
I think you are trying to scroll the #header
along with the scroll. It can be acheived by simple css.
#header
{
position:fixed;
}
精彩评论