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

我想实现 巧学巧用 文字滚动 js哪里出错了?
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
  <title>无标题页</title>
</head>
<body background="aa.jpg">

  <form id="form1" runat="server">
   
  <table width="543" border="0" cellpadding="0" cellspacing="0" >
  <tr>
  <td valign="bottom">
  <div style="width:543px; height:21; overflow:hidden" onMouseOver="stop()" onMouseOut="start()">
  </div>
   
  </td>
  </tr>
  </table>
   
   
  <table width="543" border="0" cellpadding="0" cellspacing="0" id="scrollimg" >
  <tr>
  <td id="simg">
  <table width="543" border="0" cellpadding="0" cellspacing="0" >
  <tr>
  <td nowrap="nowrap">
   
   
  <font color="#FF6C02">*</font><a href="#">1.巧学巧用dfsdgdsgdfgfgdfdsfgdsgdf</a>
  <font color="#FF6C02">*</font><a href="#">2.巧学巧用dfgfdsgsdfgdsfgdsfgdsf</a>
  <font color="#FF6C02">*</font><a href="#">3.巧学巧用dfgdsdsfgdsgd</a>
  </td>
  </tr>
  </table>
   
  </td>
  <td id="simg1"></td>
  </tr>
  </table>
  <script language="javascript" type="text/javascript">
  function newsScroll()
  {
  if(scrollimg.parentNode.scrollLeft!=(scrollimg.clientWidth/2))
  scrollimg.parentNode.scrollLeft++;
   
  else
  scrollimg.parentNode.scrollLeft=0;

   
  }

  var tm=null
  function window.onload(){
  simg1.innerHTML=simg.innerHTML

  tm=setInterval('newScroll()',20)

  }

  function stop(){
  clearInterval(tm)
  }  
  function start()
  {
  tm=setInterval('newScroll()',20)
   
  }
  </script>
   
  </form>
   
</body>
</html>


------解决方案--------------------
c井啊。。。不懂~
貌似里面没看到scrollimg这个对象啊~不知道哪里来的