主题:[讨论]一个表格中层的滚动问题
这里有两段代码,我在一个大表格中的某列内放了一个表格(下面的代码),我想实现这个表格的滚动,我用了下列代码:
<table width="283" height="226" border=" " align="center" cellpadding="0" cellspacing="0" bordercolor="#E7EBEE">
<tr>
<td width="283" height="27" align="left" valign="top"><img src="images/jipiao.gif" width="283" /></td>
</tr>
<tr>
<td align="left" valign="top" class="STYLE3">
<div style="overflow:hidden;height:200px;line-height:22px;font-size:12px" id="marqueeboxs0"><%
set rs=server.CreateObject("adodb.recordset")
sql="select * from jipiao order by id desc"
rs.open sql,conn,1,1
do while not rs.eof
%>
<table width="100%" height="50" border="1" cellpadding="0" cellspacing="0" class="css1">
<tr>
<td width="48%"><%=rs("xianlu")%></td>
<td width="36%"><%=rs("yuanjia")%></td>
<td width="16%"><%=rs("xianjia")%></td>
</tr>
</table>
<%
rs.movenext
loop
rs.close
set rs=nothing
%></div>
<script language="jscript">
function startmarquee(lhs,speeds,delays,indexs){
var y;
var k=false;
var o=document.getElementById("marqueeboxs"+indexs);
o.innerHTML+=o.innerHTML;
o.onmouseover=function(){k=true}
o.onmouseout=function(){k=false}
o.scrollTop = 0;
function start(){
y=setInterval(scrolling,speeds);
if(!k) o.scrollTop += 2;
}
function scrolling(){
if(o.scrollTop%lhs!=0){
o.scrollTop += 2;
if(o.scrollTop>=o.scrollHeight/2) o.scrollTop = 0;
}else{
clearInterval(y);
setTimeout(start,delays);
}
}
setTimeout(start,delays);
}
startmarquee(22,100,0,0);
/**startmarquee(一次滚动高度,速度,停留时间,图层标记);**/
//
</script></td>
</tr>
</table>
这段代码,放在这个列中后不显示jipiao表中的内容,但单独放在一个页面中他就会正常使用,不知是为什么!
下面还有一段代码,经我改动后,显示但不滚动,代码如下:我都快疯了!
<table width="283" height="187" border=" " align="center" cellpadding="0" cellspacing="0" bordercolor="#E7EBEE">
<tr>
<td width="299" height="27" align="left" valign="top"><img src="images/jipiao.gif" width="299" /></td>
</tr>
<tr>
<td align="left" valign="top" class="STYLE3">
<table width="100%" height="50" border="0" cellpadding="0" cellspacing="0" class="css1">
<tr>
<td class="STYLE17"><div align="center"><strong>航线</strong></div></td>
<td class="STYLE17"><div align="center"><strong>原价</strong></div></td>
<td class="STYLE17"><div align="center" class="STYLE18">特价</div></td>
</tr>
<div style="overflow:hidden;line-height:22px;font-size:12px" id="marqueeboxs0"><%
set rs=server.CreateObject("adodb.recordset")
sql="select * from jipiao order by id desc"
rs.open sql,conn,1,1
do while not rs.eof
%>
<tr>
<td width="39%"><div align="center"><span class="STYLE17"><%=rs("xianlu")%></span></div></td>
<td width="30%"><div align="center"><span class="STYLE17"><%=rs("yuanjia")%></span></div></td>
<td width="31%"><div align="center"><span class="STYLE17"><%=rs("xianjia")%></span></div></td>
</tr>
<%
rs.movenext
loop
rs.close
set rs=nothing
%> </div></table>
<script language="jscript">
function startmarquee(lhs,speeds,delays,indexs){
var y;
var k=false;
var o=document.getElementById("marqueeboxs"+indexs);
o.innerHTML+=o.innerHTML;
o.onmouseover=function(){k=true}
o.onmouseout=function(){k=false}
o.scrollTop = 0;
function start(){
y=setInterval(scrolling,speeds);
if(!k) o.scrollTop += 2;
}
function scrolling(){
if(o.scrollTop%lhs!=0){
o.scrollTop += 2;
if(o.scrollTop>=o.scrollHeight/2) o.scrollTop = 0;
}else{
clearInterval(y);
setTimeout(start,delays);
}
}
setTimeout(start,delays);
}
startmarquee(22,100,0,0);
/**startmarquee(一次滚动高度,速度,停留时间,图层标记);**/
//
</script></td>
</tr>
</table>
请哪位高手帮帮我吧!
<table width="283" height="226" border=" " align="center" cellpadding="0" cellspacing="0" bordercolor="#E7EBEE">
<tr>
<td width="283" height="27" align="left" valign="top"><img src="images/jipiao.gif" width="283" /></td>
</tr>
<tr>
<td align="left" valign="top" class="STYLE3">
<div style="overflow:hidden;height:200px;line-height:22px;font-size:12px" id="marqueeboxs0"><%
set rs=server.CreateObject("adodb.recordset")
sql="select * from jipiao order by id desc"
rs.open sql,conn,1,1
do while not rs.eof
%>
<table width="100%" height="50" border="1" cellpadding="0" cellspacing="0" class="css1">
<tr>
<td width="48%"><%=rs("xianlu")%></td>
<td width="36%"><%=rs("yuanjia")%></td>
<td width="16%"><%=rs("xianjia")%></td>
</tr>
</table>
<%
rs.movenext
loop
rs.close
set rs=nothing
%></div>
<script language="jscript">
function startmarquee(lhs,speeds,delays,indexs){
var y;
var k=false;
var o=document.getElementById("marqueeboxs"+indexs);
o.innerHTML+=o.innerHTML;
o.onmouseover=function(){k=true}
o.onmouseout=function(){k=false}
o.scrollTop = 0;
function start(){
y=setInterval(scrolling,speeds);
if(!k) o.scrollTop += 2;
}
function scrolling(){
if(o.scrollTop%lhs!=0){
o.scrollTop += 2;
if(o.scrollTop>=o.scrollHeight/2) o.scrollTop = 0;
}else{
clearInterval(y);
setTimeout(start,delays);
}
}
setTimeout(start,delays);
}
startmarquee(22,100,0,0);
/**startmarquee(一次滚动高度,速度,停留时间,图层标记);**/
//
</script></td>
</tr>
</table>
这段代码,放在这个列中后不显示jipiao表中的内容,但单独放在一个页面中他就会正常使用,不知是为什么!
下面还有一段代码,经我改动后,显示但不滚动,代码如下:我都快疯了!
<table width="283" height="187" border=" " align="center" cellpadding="0" cellspacing="0" bordercolor="#E7EBEE">
<tr>
<td width="299" height="27" align="left" valign="top"><img src="images/jipiao.gif" width="299" /></td>
</tr>
<tr>
<td align="left" valign="top" class="STYLE3">
<table width="100%" height="50" border="0" cellpadding="0" cellspacing="0" class="css1">
<tr>
<td class="STYLE17"><div align="center"><strong>航线</strong></div></td>
<td class="STYLE17"><div align="center"><strong>原价</strong></div></td>
<td class="STYLE17"><div align="center" class="STYLE18">特价</div></td>
</tr>
<div style="overflow:hidden;line-height:22px;font-size:12px" id="marqueeboxs0"><%
set rs=server.CreateObject("adodb.recordset")
sql="select * from jipiao order by id desc"
rs.open sql,conn,1,1
do while not rs.eof
%>
<tr>
<td width="39%"><div align="center"><span class="STYLE17"><%=rs("xianlu")%></span></div></td>
<td width="30%"><div align="center"><span class="STYLE17"><%=rs("yuanjia")%></span></div></td>
<td width="31%"><div align="center"><span class="STYLE17"><%=rs("xianjia")%></span></div></td>
</tr>
<%
rs.movenext
loop
rs.close
set rs=nothing
%> </div></table>
<script language="jscript">
function startmarquee(lhs,speeds,delays,indexs){
var y;
var k=false;
var o=document.getElementById("marqueeboxs"+indexs);
o.innerHTML+=o.innerHTML;
o.onmouseover=function(){k=true}
o.onmouseout=function(){k=false}
o.scrollTop = 0;
function start(){
y=setInterval(scrolling,speeds);
if(!k) o.scrollTop += 2;
}
function scrolling(){
if(o.scrollTop%lhs!=0){
o.scrollTop += 2;
if(o.scrollTop>=o.scrollHeight/2) o.scrollTop = 0;
}else{
clearInterval(y);
setTimeout(start,delays);
}
}
setTimeout(start,delays);
}
startmarquee(22,100,0,0);
/**startmarquee(一次滚动高度,速度,停留时间,图层标记);**/
//
</script></td>
</tr>
</table>
请哪位高手帮帮我吧!