开发者

JQuery ScrollTop IE,Opera

I scroll browser screen to Div element by his ID.

/* Scroll screen to Menu  */
if ($("#menu").offset().top != 0) {
    $("html,body").animate开发者_运维问答({ scrollTop: $("#menu").offset().top }, 1200);
} 

But in Opera and IE 7,8 , after i scroll it, the $("#menu").offset().top isn't 0, how i can fix it ? Now if i call again this script, screen scroll from same place. (in FireFox a Chrome is work fine)


Try this one if ($("#menu").offset().top != 0) { $("html,body").animate({ scrollTop: 0 }, 1200); }

I hope this will workout

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜