$("body").animate({"scrollTop": top})被Firefox支持问题的解决:

其实是因为使用了body的:


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

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

 

而使用html的:


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

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

 

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


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

就是将html和body这两者都加上就可以了。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-14
  • 2021-09-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-29
  • 2022-12-23
  • 2022-12-23
  • 2021-06-17
  • 2021-12-14
  • 2021-12-16
  • 2022-12-23
相关资源
相似解决方案