导入<script src="<%=path%>/html5/js/jquery.js"></script>文件

 

<SCRIPT type="text/javascript">

$(document).ready(function(){
  var menuYloc = $("#DIVFLOAT").offset().top;
  $(window).scroll(function (){
  var offsetTop = menuYloc + $(window).scrollTop() +"px";
  $("#DIVFLOAT").animate({top : offsetTop },{ duration:100 , queue:false });
  });
});

</SCRIPT>

 

<body>                                   <!--与top的距离-->
<div style="POSITION: absolute; top:50px ; left: 100px;background-color: white; width: 50px;padding-left: 60px" >
<table>

<c:forEach begin="1" end="4" step="1" var="i" >
<tr>
<td>DIV广告浮动效果</td>
<td>&nbsp;&nbsp;</td>
</tr>

</c:forEach>
</table>
</div>

<div style="float:left; top:40px;left:30px;background-color:white;width:100px;">
<c:forEach begin="1" end="200" step="1" var="i" varStatus="r" >
<table>
<tr>
<td>左边参照${i }==${r.index }==${r.count }</td>
</tr>
</table>
</c:forEach>
</div>
</body>

相关文章:

  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
  • 2021-05-18
  • 2021-12-19
  • 2021-09-20
  • 2021-09-16
  • 2021-11-07
猜你喜欢
  • 2022-01-15
  • 2022-12-23
  • 2022-02-18
  • 2021-07-30
  • 2021-12-23
  • 2021-07-24
  • 2022-12-23
相关资源
相似解决方案