码迷,mamicode.com
首页 > Web开发 > 详细

jQuery中animate()方法以及$('body').animate({"scrollTop":top})不被Firefox支持问题的解决

时间:2017-09-09 19:42:54      阅读:314      评论:0      收藏:0      [点我收藏+]

标签:body   rom   style   htm   问题   scrolltop   anim   color   animate   

$("body").animate({"scrollTop":top}):

只被chrome支持,而不被Firefox支持

$("html").animate({"scrollTop":top}):

只被Firefox支持,而不被chrome支持。

如果想让这段js被chrome和Firefox都支持的话,应该这样:

$("html,body").animate({"scrollTop":top});

jQuery中animate()方法以及$('body').animate({"scrollTop":top})不被Firefox支持问题的解决

标签:body   rom   style   htm   问题   scrolltop   anim   color   animate   

原文地址:http://www.cnblogs.com/rachelch/p/7498966.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!