向上滚动的js代码,ie8下测试通过

代码如下:

<div id="mar" onmouseover="clearInterval(inter);" style="overflow: hidden; height: 180px; width: 200px" onmouseout="inter=setInterval(qswhMarquee,30);">
  <div id="mar1">
    <table cellSpacing="0" cellPadding="0" width="101%" border="0" id="table2">
      <tr>
        <td class="tj_sp02"><a class="blackno" target="blank" href="#">向上滚动代码</a></td>
      </tr>
      <tr>
        <td class="tj_sp02"><a class="blackno" target="blank" href="#">向上滚动代码</a></td>
      </tr>
      <tr>
        <td class="tj_sp02"><a class="blackno" target="blank" href="#">向上滚动代码</a></td>
      </tr>
      <tr>
        <td class="tj_sp02"><a class="blackno" target="blank" href="#">向上滚动代码</a></td>
      </tr>
      <tr>
        <td class="tj_sp02"><a class="blackno" target="blank" href="#">向上滚动代码</a></td>
      </tr>
      <tr>
        <td class="tj_sp02"><a class="blackno" target="blank" href="#">向上滚动代码</a></td>
      </tr>
      <tr>
        <td class="tj_sp02"><a class="blackno" target="blank" href="#">向上滚动代码</a></td>
      </tr>
      <tr>
        <td class="tj_sp02"><a class="blackno" target="blank" href="#">向上滚动代码</a></td>
      </tr>
      <tr>
        <td class="tj_sp02"><a class="blackno" target="blank" href="/">向上滚动代码</a></td>
      </tr>
      <tr>
        <td class="tj_sp02"><a class="blackno" target="blank" href="/">向上滚动代码</a></td>
      </tr>
      <tr>
        <td class="tj_sp02"><a class="blackno" target="blank" href="/">向上滚动代码</a></td>
      </tr>
    </table>
  </div>
  <div id="mar2">  </div>
</div>
<SCRIPT language=javascript>
var speed=10
var t=mar.scrollTop
mar2.innerHTML=mar1.innerHTML
function qswhMarquee(){
if(mar2.offsetTop-mar.scrollTop<=0)
mar.scrollTop-=mar1.offsetHeight
else
mar.scrollTop++
}
inter=setInterval(qswhMarquee,30)
      </SCRIPT>
 

    相关文章

评论

发表新评论

此内容将保密,不会被其他人看见。
点击刷新验证码
  • 可用的 UBB 标签:
  • 留言最长字数:1000。