jquery平滑滚动到锚点 一行代码时间:2023-03-08 23:22:29 $("html,body").animate({scrollTop: $("#box").offset().top}, 1000); $("#box")是要去到的锚点,$("html,body")是默认的,不用动。