How to make div follow scrolling smoothly with jQuery?

后端 未结 10 2364
我寻月下人不归
我寻月下人不归 2020-11-28 19:24

In my container there are sections/boxes, but the last one of these boxes should follow scrolling when none of the other boxes are visible.

So, when user sc

10条回答
  •  隐瞒了意图╮
    2020-11-28 19:54

    That code doesn't work very well i fixed it a little bit

    var el = $('.caja-pago');
    var elpos_original = el.offset().top;
    
     $(window).scroll(function(){
         var elpos = el.offset().top;
         var windowpos = $(window).scrollTop();
         var finaldestination = windowpos;
         if(windowpos

提交回复
热议问题