使用body的:
$("body").animate({"scrollTop":top})
只被chrome支持,而不被Firefox支持。
而使用html的:
$("html").animate({"scrollTop":top})
只被Firefox支持,而不被chrome支持。
如果想让这段js被chrome和Firefox都支持的话,应该这样:
$("html,body").animate({"scrollTop":top})
使用body的:
$("body").animate({"scrollTop":top})
只被chrome支持,而不被Firefox支持。
而使用html的:
$("html").animate({"scrollTop":top})
只被Firefox支持,而不被chrome支持。
如果想让这段js被chrome和Firefox都支持的话,应该这样:
$("html,body").animate({"scrollTop":top})