获取元素top值,屏幕滚动到当前元素 var top = $(this).offset().top; $('html , body').animate({scrollTop: top-100},10);