开发者

Jquery jitter ie

开发者 https://www.devze.com 2023-03-28 05:36 出处:网络
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?

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;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消