1.利用a标签

锚点跳转的方式
2.屏幕滚动
①html设置
锚点跳转的方式
②js代码

 // 锚点跳转
    function goToEle() {
        var $index = $(this).index();
        $("html, body").animate({
            scrollTop: $("#scrolltop-" + $index).offset().top
        }, {
                duration: 500,
                easing: "swing"
            });
        return false;
    }
$(document).on("click",".tui-type-jump li",goToEle);

第一种方式不用js
第二种个人认为效果要好一点,比第一种复杂

相关文章: