html广告向下跟随移动代码

  广告向下跟随移动代码

  1、DIV 中加入 id="pin"

  2、3、

  $(window).scroll(function() { var h = $(window).height(); var top = $(window).scrollTop(); var rFixedBox = $('#pin').prev().offset(); var fixedTop = rFixedBox.top; if(top>=fixedTop+$('#pin').prev().height()) $('#pin').css({'position':'fixed','top': 0}); else $('#pin').css({'position':'static', 'top':0}); });

  html广告向下跟随移动代码相关内容:

    分页:123