日期:2014-05-16  浏览次数:20520 次

漂浮层在火狐不兼容
<div id="advimg" style="position: absolute; top: 129px; width: 104px; height: 129px;
  z-index: 1; cursor: pointer; right: 1px;">
  <img src="../../Content/themes/images/lyjy.jpg" />
</div>

<script type="text/javascript">
  var advInitTop = 190;
  function move() {
  document.getElementById("advimg").style.pixelTop = advInitTop + document.documentElement.scrollTop;
  }
  window.onscroll = move;

</script>
图片随着滚动条滚动,在ie和360都能行,但是在火狐下面就不行,求大侠办给我看看

------解决方案--------------------
JScript code

<script type="text/javascript">
  var advInitTop = 190;
  function move() {
  document.getElementById("advimg").style.[color=#FF0000]top [/color]= (advInitTop + document.documentElement.scrollTop)+"px";
  }
  window.onscroll = move;
</script>