开发者

Jquery jitter ie

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜