本分分享如何使用jQuery实现点击平滑滚动效果
主要js与解释
<script>
$(function () {
$(".tabs a").click(function () {
$("body,html").animate({
scrollTop: $($(this).attr('href')).offset().top - 10
}, 500);
$(".tabs a").removeClass('active')
$(this).addClass('active')
return false
})
})
</script>
