主要是后面那段,alert是我加上去的。本来希望达到滚动显示的效果,可实际运行中,却不是这样的。
<!--#include file="Include/conn.asp"-->
<!--#include file="Include/Fun_SqlIn.Asp"-->
<!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><meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title><%=SiteTitle%></title>
<meta name="keywords" content="<%=Sitekeywords%>" />
<meta name="description" content="<%=Sitedescription%>" />
<link href="images/style.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="images/Zhirui.js"></script>
<style type="text/css">
<!--
.STYLE4 {color: #FFFFFF}
-->
</style>
</head>
<body onload=init1()>
<%head()%>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:5px; margin-bottom:5px;">
<tr>
<td>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id=scriptmain name=scriptmain codebase="http://download.macromedia.com/pub/shockwave/cabs/
flash/swflash.cab#version=6,0,29,0" width="950" height="150">
<param name="movie" value="images/bcastr.swf?bcastr_xml_url=images/bcastr.xml">
<param name="quality" value="high">
<param name=scale value=noscale>
<param name="LOOP" value="false">
<param name="menu" value="false">
<param name="wmode" value="transparent">
<embed src="images/bcastr.swf?bcastr_xml_url=images/bcastr.xml" width="950" height="150" loop="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" salign="T" name="scriptmain" menu="false" wmode="transparent"></embed>
</object></td>
</tr>
</table>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:10px;">
<tr>
<td width="650" height="28" valign="top" ><table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" background="Images/Menu.jpg"><a href="Photo_list.asp"><span style="color: #FFFFFF;font-weight: bold;">最新产品</span></a></td>
</tr>
</table></td>
<td width="20" rowspan="2" valign="top"></td>
<td width="280" rowspan="2" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="28" align="center" background="Images/Inmu.jpg"><a href="about.asp" class="STYLE4 STYLE4"><span style="font-weight: bold;">企业简介</span></a></td>
</tr>
<tr>
<td height="180" style="border-left:1px solid #cbcbcb;border-right:1px solid #cbcbcb; border-bottom:1px solid #cbcbcb; "><div style="margin-left:5px; margin-right:5px;"><%Call Label(12)%></div>
</td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" valign="top" background="Images/Mebg.jpg" ><!--<%=PhotoDex()%>-->
<table>
<tr>
<th width="83" align="center" >品名</td>
<th width="96" align="center" >材质</td>
</tr>
</table>
<div id="templayer" style="position:absolute;z-index:1;visibility:hidden"></div>
<table>
<div id="marqueey"><!--连续滚动的字测试1<BR>连续滚动的字测试2<BR>连续滚动的字测试3<BR>连续滚动的字测试4<BR>-->
<%
set rx=server.CreateObject("adodb.Recordset")
sql="select * from tab1"'zhi_rui_e_Navigation "
rx.open sql,conn,1,1
do while not rx.eof
%>
<tr>
<td width="83" align="center"><%=rx("品名")%></td>
<td width="96" align="center"><%=rx("材质")%></td>
</tr>
<%'=rx("规格")%>
<%
rx.movenext
loop
rx.close
set rx=Nothing
%>
</div>
<SCRIPT language=JavaScript>
marqueeyHeight=140; //载体高度控制
stopscroll=false;
with(marqueey){
style.width=0;
style.height=marqueeyHeight;
style.overflowX="visible";
style.overflowY="hidden";
noWrap=true;
onmouseover=new Function("stopscroll=true");
onmouseout=new Function("stopscroll=false");
}
//document.write('<div id="templayer" style="position:absolute;z-index:1;visibility:hidden"></div>');
preTop=0; currentTop=0;function init1(){
alert("aa")
templayer.innerHTML="aa";
while(templayer.scrollHeight<marqueeyHeight){
alert(marqueey.innerHTML)
templayer.innerHTML+=marqueey.innerHTML;
alert(templayer.innerHTML)
}
marqueey.innerHTML=templayer.innerHTML+templayer.innerHTML;
alert("bb")
setInterval("scrollUp()",40); //滚动速度控制,越大越慢
}
//document.body.onload=init1;
function scrollUp(){
if(stopscroll==true) return;
preTop=marqueey.scrollTop;
marqueey.scrollTop+=1;
if(preTop==marqueey.scrollTop){
marqueey.scrollTop=templayer.offsetHeight-marqueeyHeight;
marqueey.scrollTop+=1;
}
}
</SCRIPT>
</table>
</td>
</tr>
</table>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:10px;">
<tr>
<td width="650" valign="top"><div id="tabs0">
<ul class="menu0" id="menu0">
<li onclick="setTab(0,0)" class="hover">行业动态</li>
<li onclick="setTab(0,1)">财经要闻</li>
<li onclick="setTab(0,2)">企业新闻</li>
</ul>
<div class="main" id="main0">
<ul class="block">
<li><%=DeNews(27)%></li>
</ul>
<ul>
<li><%=DeNews(25)%> </li>
</ul>
<ul>
<li><%=DeNews(30)%> </li>
</ul>
</div>
</div></td>
<td width="20" valign="top"></td>
<td width="280" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="28" align="center" background="Images/Inmu.jpg"><a href="http://www.zhirui.net"><span style="color: #FFFFFF;font-weight: bold;">服务咨询</span></a></td>
</tr>
<tr>
<td height="180" style="border-left:1px solid #cbcbcb;border-right:1px solid #cbcbcb; border-bottom:1px solid #cbcbcb;"><%Call Label(10)%>
</td>
</tr>
</table></td>
</tr>
</table>
<%Bottom()%>
</body>
</html>
<!--#include file="Include/conn.asp"-->
<!--#include file="Include/Fun_SqlIn.Asp"-->
<!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><meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title><%=SiteTitle%></title>
<meta name="keywords" content="<%=Sitekeywords%>" />
<meta name="description" content="<%=Sitedescription%>" />
<link href="images/style.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="images/Zhirui.js"></script>
<style type="text/css">
<!--
.STYLE4 {color: #FFFFFF}
-->
</style>
</head>
<body onload=init1()>
<%head()%>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:5px; margin-bottom:5px;">
<tr>
<td>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id=scriptmain name=scriptmain codebase="http://download.macromedia.com/pub/shockwave/cabs/
flash/swflash.cab#version=6,0,29,0" width="950" height="150">
<param name="movie" value="images/bcastr.swf?bcastr_xml_url=images/bcastr.xml">
<param name="quality" value="high">
<param name=scale value=noscale>
<param name="LOOP" value="false">
<param name="menu" value="false">
<param name="wmode" value="transparent">
<embed src="images/bcastr.swf?bcastr_xml_url=images/bcastr.xml" width="950" height="150" loop="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" salign="T" name="scriptmain" menu="false" wmode="transparent"></embed>
</object></td>
</tr>
</table>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:10px;">
<tr>
<td width="650" height="28" valign="top" ><table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" background="Images/Menu.jpg"><a href="Photo_list.asp"><span style="color: #FFFFFF;font-weight: bold;">最新产品</span></a></td>
</tr>
</table></td>
<td width="20" rowspan="2" valign="top"></td>
<td width="280" rowspan="2" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="28" align="center" background="Images/Inmu.jpg"><a href="about.asp" class="STYLE4 STYLE4"><span style="font-weight: bold;">企业简介</span></a></td>
</tr>
<tr>
<td height="180" style="border-left:1px solid #cbcbcb;border-right:1px solid #cbcbcb; border-bottom:1px solid #cbcbcb; "><div style="margin-left:5px; margin-right:5px;"><%Call Label(12)%></div>
</td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" valign="top" background="Images/Mebg.jpg" ><!--<%=PhotoDex()%>-->
<table>
<tr>
<th width="83" align="center" >品名</td>
<th width="96" align="center" >材质</td>
</tr>
</table>
<div id="templayer" style="position:absolute;z-index:1;visibility:hidden"></div>
<table>
<div id="marqueey"><!--连续滚动的字测试1<BR>连续滚动的字测试2<BR>连续滚动的字测试3<BR>连续滚动的字测试4<BR>-->
<%
set rx=server.CreateObject("adodb.Recordset")
sql="select * from tab1"'zhi_rui_e_Navigation "
rx.open sql,conn,1,1
do while not rx.eof
%>
<tr>
<td width="83" align="center"><%=rx("品名")%></td>
<td width="96" align="center"><%=rx("材质")%></td>
</tr>
<%'=rx("规格")%>
<%
rx.movenext
loop
rx.close
set rx=Nothing
%>
</div>
<SCRIPT language=JavaScript>
marqueeyHeight=140; //载体高度控制
stopscroll=false;
with(marqueey){
style.width=0;
style.height=marqueeyHeight;
style.overflowX="visible";
style.overflowY="hidden";
noWrap=true;
onmouseover=new Function("stopscroll=true");
onmouseout=new Function("stopscroll=false");
}
//document.write('<div id="templayer" style="position:absolute;z-index:1;visibility:hidden"></div>');
preTop=0; currentTop=0;function init1(){
alert("aa")
templayer.innerHTML="aa";
while(templayer.scrollHeight<marqueeyHeight){
alert(marqueey.innerHTML)
templayer.innerHTML+=marqueey.innerHTML;
alert(templayer.innerHTML)
}
marqueey.innerHTML=templayer.innerHTML+templayer.innerHTML;
alert("bb")
setInterval("scrollUp()",40); //滚动速度控制,越大越慢
}
//document.body.onload=init1;
function scrollUp(){
if(stopscroll==true) return;
preTop=marqueey.scrollTop;
marqueey.scrollTop+=1;
if(preTop==marqueey.scrollTop){
marqueey.scrollTop=templayer.offsetHeight-marqueeyHeight;
marqueey.scrollTop+=1;
}
}
</SCRIPT>
</table>
</td>
</tr>
</table>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:10px;">
<tr>
<td width="650" valign="top"><div id="tabs0">
<ul class="menu0" id="menu0">
<li onclick="setTab(0,0)" class="hover">行业动态</li>
<li onclick="setTab(0,1)">财经要闻</li>
<li onclick="setTab(0,2)">企业新闻</li>
</ul>
<div class="main" id="main0">
<ul class="block">
<li><%=DeNews(27)%></li>
</ul>
<ul>
<li><%=DeNews(25)%> </li>
</ul>
<ul>
<li><%=DeNews(30)%> </li>
</ul>
</div>
</div></td>
<td width="20" valign="top"></td>
<td width="280" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="28" align="center" background="Images/Inmu.jpg"><a href="http://www.zhirui.net"><span style="color: #FFFFFF;font-weight: bold;">服务咨询</span></a></td>
</tr>
<tr>
<td height="180" style="border-left:1px solid #cbcbcb;border-right:1px solid #cbcbcb; border-bottom:1px solid #cbcbcb;"><%Call Label(10)%>
</td>
</tr>
</table></td>
</tr>
</table>
<%Bottom()%>
</body>
</html>
<!-- #include file = "Include/conn.asp" -->
<HTML>
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.3020" name=GENERATOR>
</HEAD>
<BODY>
<table>
<tr>
<th width="83" align="center" >品名</td>
<th width="96" align="center" >材质</td>
<th width="97" align="center" >规格</td>
<th width="70" align="center" >价格</td>
<th width="70" align="center" >数量</td>
<th width="78" align="center" >产地</td></tr>
</table>
<DIV
id=marqueey><!--连续滚动的字测试1<BR>连续滚动的字测试2<BR>连续滚动的字测试3<BR>连续滚动的字测试4<BR>-->
<table>
<%
set rx=server.CreateObject("adodb.Recordset")
sql="select * from tab1"'zhi_rui_e_Navigation "
rx.open sql,conn,1,1
do while not rx.eof%>
<tr>
<td width="83" align="center"><%=rx("品名")%></td>
<td width="96" align="center"><%=rx("材质")%></td>
<td width="97" align="center"><%=rx("规格")%></td>
<td width="70" align="center"><%=rx("价格")%></td>
<td width="70" align="center"><%=rx("数量")%></td>
<td width="78" align="center"><%=rx("钢厂")%></td>
</tr> <%'=rx("规格")%>
<%
rx.movenext
loop
rx.close
set rx=Nothing
%> </table>
</DIV>
<SCRIPT language=JavaScript>
marqueeyHeight=340; //载体高度控制
stopscroll=false;
with(marqueey){
style.width=0;
style.height=marqueeyHeight;
style.overflowX="visible";
style.overflowY="hidden";
noWrap=true;
onmouseover=new Function("stopscroll=true");
onmouseout=new Function("stopscroll=false");
}
document.write('<div id="templayer" style="position:absolute;z-index:1;visibility:hidden"></div>');
preTop=0; currentTop=0;
function init1(){
templayer.innerHTML="";
while(templayer.offsetHeight<marqueeyHeight){
templayer.innerHTML+=marqueey.innerHTML;
}
marqueey.innerHTML=templayer.innerHTML+templayer.innerHTML;
setInterval("scrollUp()",40); //滚动速度控制,越大越慢
}
document.body.onload=init1;
function scrollUp(){
if(stopscroll==true) return;
preTop=marqueey.scrollTop;
marqueey.scrollTop+=1;
if(preTop==marqueey.scrollTop){
marqueey.scrollTop=templayer.offsetHeight-marqueeyHeight;
marqueey.scrollTop+=1;
}
}
</SCRIPT>
</BODY></HTML>
alert(marqueey.innerHTML),这个每次都是25
templayer.innerHTML+=marqueey.innerHTML;
alert(templayer.innerHTML),这个越来越长,就是 连续滚动的字测试1<BR>连续滚动的字测试2<BR>连续滚动的字测试3<BR>连续滚动的字测试4<BR>-->不断累加。
为什么不是表中的内容呢?