锚点盒子随滚动条浮动

// 随滚动条浮动
    $('.Step_points').width($('.Leftbox').width());
    var Step_points_top=$('.Step_points').offset().top;
    $(window).scroll(function(){
        console.log($(window).scrollTop());
        if($(window).scrollTop()>Step_points_top){
            $('.Step_points').addClass('fixed');
        }else{
            $('.Step_points').removeClass('fixed');
        }
    });

原文地址:https://www.cnblogs.com/ghfjj/p/7920349.html