scrollTop doesn’t work on firefox and IE? 解决之法

星期四, 2017-06-01 | Author: Lee | html5, JAVA-and-J2EE | 2,325 views

在使用jquery的 animate 的scrollTop 返回顶部的时,在chrome使用是好的,但是在IE下无效.

解决方法:
try using

$('body,html').animate({scrollTop:$(this).offset().top},800);

instead of

$("body").animate({scrollTop:$(this).offset().top},800);

Tags:

文章作者: Lee

本文地址: https://www.pomelolee.com/1724.html

除非注明,Pomelo Lee文章均为原创,转载请以链接形式标明本文地址

No comments yet.

Leave a comment

Search

文章分类

Links

Meta