jquery两行代码即可实现:

var pos = $("#" + targetele).offset().top;
$("html,body").animate({ scrollTop: pos }, 1000);

 

相关文章: