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
精彩评论