设置锚点

 
 
 
 
//导航栏的定位
$(document).scroll(function() {
    if($(document).scrollTop() > 442) {
        $(".nav").css({
            "position": "fixed",
            "background": "#ffffff",
            "top": "0px",
            "z-index": "10"

        });
}
//设置锚点
$(".nav_ul").children("li").eq(0).click(function () {
    $("html,body").animate({scrollTop: $(".page1").offset().top-100}, 1000);}
)

猜你喜欢

转载自blog.csdn.net/weixin_39041271/article/details/79636010
今日推荐