jq 锚点带缓冲

<script type="text/javascript" src="js/jquery.easing.1.3.js"></script>
       <script type="text/javascript">
            $(function() {
                $('ul.nav a').bind('click',function(event){
                    var $anchor = $(this);
                    
                    $('html, body').stop().animate({
                        scrollTop: $($anchor.attr('href')).offset().top
                    }, 3000,'easeInOutExpo');
                    event.preventDefault();
                });
            });		
</script>

  

原文地址:https://www.cnblogs.com/wqing/p/2766430.html