开发者

jQuery Animate top: Does not work in Chrome

Ok so I really cant figure out why this code is not working. Works fine in other browsers but in Chrome the bar does not scroll.

I have a toolbar I want to scroll up and down the page. This works in other browsers but not Chrome:

$("#toolbar").stop().animate({top: 100}, 1000);

It really does not make any sens开发者_运维问答e to me... Here is the CSS:

#toolbar{
position:absolute;
top:50px;
left:0px;
z-index:9999;
width:100%;}

Currently the only think in the div is text can anyone help!?


Use stop with arguments, for instance stop(true,false). This should fix the behavior in Chrome.


Try this:

$("#toolbar").stop().animate({top: '100px'}, 1000);


instead of top, use {"padding-top":"+=15px"} to be relative

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜