首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

请帮忙一下 这个js代码无法在moxilla firefox实现滚动功能 急该怎么解决

2011-12-28 
请帮忙一下这个js代码无法在moxilla firefox实现滚动功能急div idwpbody_rightdiv classright_001

请帮忙一下 这个js代码无法在moxilla firefox实现滚动功能 急
<div id="wpbody_right">
<div class="right_001">
  <div id="apDiv3" style="display:none"><% set rs=server.createobject("adodb.recordset")
sql="select * from lb where px=0 " 'order by p ascorder by gid desc  
rs.open sql,conn,1,1
b=1  
%><% While Not rs.EOF%>&nbsp;&nbsp;&nbsp;<%= rs("ytltitle") %> <% rs.movenext
b=b+1
wend
rs.close%></div>
</div>
<div class="right_004"><table border="0" width="100%" cellspacing="5" cellpadding="0">
<tr>
<td width="2%"><img src="images/moveleft.gif" alt="向左移动" name="r_l" width="17" height="83" id="r_l" onClick="r_left()"></td>
<td width="95%">
<TABLE cellSpacing=0 cellPadding=0 width=100% border=0>
  <TBODY>
  <TR>
  <TD vAlign=top background="" height=120>
  <TABLE cellSpacing=0 cellPadding=0 width=100% border=0>
  <TBODY>
  <TR>
  <TD vAlign=center align=middle ><div id=demo style="OVERFLOW: hidden; WIDTH: 100%; COLOR: #ffffff; HEIGHT: 160px">
  <table cellpadding=0 width="100%" align=left border=0 
  cellspace="0">
  <tbody>
  <tr>
  <!--------------------demo1--------------------->
  <td width="100%" valign=top id=demo1><table width="160" cellpadding=1 cellspacing=1>
  <tbody>
  <tr valign=top>
  <td width="160" valign=top nowrap><div align=right>
  <table cellspacing=0 cellpadding=0 align=center border=0>
  <tbody>
  <tr>
  <% set rs=server.createobject("adodb.recordset")
sql="select * from zhword where newshow=1 order by id desc "'
rs.open sql,conn,1,1
 
%>
  <% do While Not rs.EOF%>
  <td align=middle><table cellspacing=0 cellpadding=0 width=140
  align=center border=0>
  <tbody>
  <tr>
  <td align=center height=160 width=140><a href="cproshow.asp?id=<%= rs("id") %>" target="_blank"><img height=150 
  src="<%= rs("upfile") %>" width=130
  border=0 class="kuang" title="<%= rs("upname") %>" /></a></td>
  <td width="5"></td>
  </tr>
  </tbody>
  </table></td>
  <%
rs.movenext
loop
rs.close %>


  </tr>
  </tbody>
  </table>
  </div></td>
  </tr>
  </tbody>
  </table></td>
  <td id=demo2 width="1"></td>
  </tr>
  </tbody>
  </table>
  </div>
  <SCRIPT>
var dir=1;//每步移动像素,大=快
var speed=1;//循环周期(毫秒)大=慢
var demo2 = document.getElementById("demo2");
var demo1 = document.getElementById("demo1");
var demo = document.getElementById("demo");
demo2.innerHTML=demo1.innerHTML;
function Marquee(){//正常移动
//alert(demo2.offsetWidth+"\n"+demo.scrollLeft)
if (dir>0 && (demo2.offsetWidth-demo.scrollLeft)<=0) demo.scrollLeft=0;
if (dir<0 &&(demo.scrollLeft<=0)) demo.scrollLeft=demo2.offsetWidth;
demo.scrollLeft+=dir;

demo.onmouseover=function() {clearInterval(MyMar)}//暂停移动
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}//继续移动
}
function r_left(){if (dir=-1)dir=1}//换向左移
function r_right(){if (dir=1)dir=-1}//换向右移


var MyMar=setInterval(Marquee,speed)

</SCRIPT> </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></td>
<td width="3%"><img src="images/moveright.gif" alt="向右移动" name="r_r" width="17" height="83" id="r_r" onClick="r_right()"></td>
</tr>
</table></div>

</div>

[解决办法]
发到js区去。这里的人,怎么帮你啊。呵。

热点排行