数据库读取的图文怎么实现自动滚动自动暂停一直循环 通过两个一摸一样的TABLE来实现无间隙播放 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><TITLE> New Document </TITLE><META NAME="Generator" CONTENT="EditPlus"><META NAME="Author" CONTENT=""><META NAME="Keywords" CONTENT=""><META NAME="Description" CONTENT=""></HEAD><BODY><marquee id=mq1 direction=up ><ul><li>昏睡百年,国人渐已醒<li>睁开眼吧,小心看吧<li>哪个愿臣虏自认<li>因为畏缩与忍让<li>人家骄气日盛<li>开口叫吧,高声叫吧<li>这里是全国皆兵<li>历来强盗要侵入<li>最终必送命<li>万里长城永不到<li>千里黄河水滔滔<li>江山秀丽叠彩锋岭<li>问我国家哪像染病<li>冲开血路,挥手上吧<li>要致力国家中兴<li>岂让国土再遭践踏<li>个个负起使命<li>这睡狮已渐已醒</ul></marquee><SCRIPT language=JavaScript>function mq1stop(){mq1.stop();window.setTimeout("mq1start()",8000)}function mq1start(){mq1.start();window.setTimeout("mq1stop()",4000)}mq1start();</SCRIPT></BODY></HTML> 有。http://ucren.com/DronFw/Example/ScrollBox.html<style type="text/css"> * { font-size:12px; } #scrollBox { width:250px; height:20px; line-height:20px; overflow:hidden; background-color:#eee; } #scrollBox2 { width:280px; height:60px; line-height:20px; overflow:hidden; background-color:#eee; }</style>单行例子:(每屏一行)<br><br><div id="scrollBox">中国去年进口原油 11%来自上合成员<br />美:中国对台湾立场 似转趋和缓<br />美制裁四家中国公司 中方表示强烈不满<br />中伊关系加温 大陆波斯餐厅开幕</div><br>多行例子:(每屏三行)<br><br><div id="scrollBox2">为何暂停UN登记武器转让 中方做解释<br>追悼空军运输机遇难者 胡锦涛送花圈<br>中国控制互联网?外交部发言人驳斥<br>美国移民局逮2179人 包括1华人蛇头<br>奇男子能嚼咽双刃刀片 用鼻子喝茶<br>男子持塑料玩具枪 劫走四十多吨铜(图)<br>餐馆当街宰小猫做肉丸 场面血腥(图)<br>男子软禁妻子近5年 称是替其驱妖魔<br>男子杀死同居女友 与腐尸共宿八天<br>年轻妻子欲卖肾救夫 88篇日记感人<br>曾志伟父亲节双喜临门 获美荣誉博士</div><Script type="text/JavaScript">//类内容ScrollBox = function (uid){ this.scrollBox = document.getElementById(uid); this.scrollBoxHeight = this.scrollBox.clientHeight; this.scrollBoxInner = this.scrollBox.innerHTML; this.scrollCol = this.scrolln = 0; this.setScroll = function () { this.scrollBox.scrollTop = this.scrollCol + this.scrolln; if(this.scrolln==this.scrollBoxHeight) return this.addScroll() else this.scrolln ++; var o = this; function m(){o.setScroll();} setTimeout(m,20); } this.addScroll = function () { this.scrollBox.innerHTML += "<br>" + this.scrollBoxInner; this.scrollCol = this.scrollBox.scrollTop; this.scrolln = 0; var o = this; function m(){o.setScroll();} setTimeout(m,1000); } this.addScroll();}//使用方法new ScrollBox("scrollBox");new ScrollBox("scrollBox2");</Script> 这个你可以满意吧?在CSS内容中自己定义好高度就行。 类似网易旅游频道的效果,阿里巴巴那改来的===================================================================================<SCRIPT language=JavaScript src="inc/TopImgToggle.js"></SCRIPT> <% sqlt="select top 4 id,bpic from tour order by id desc" set rst=conn.execute(sqlt) if not rst.eof then i=1 %> <TABLE width="100%" border=0 align="center" cellPadding=0 cellSpacing=0> <TBODY> <tr> <td height="10" bgcolor="#F7F7F7" colspan="9"></td> </tr> <TR> <TD colSpan="9" align="center" bgcolor="#F7F7F7"><DIV id=oTransContainer style="FILTER: progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0, motion='forward'); WIDTH: 480px; HEIGHT: 220px"> <% do while not rst.eof %> <A href="view.asp?id=<%=rst("id")%>" target=_blank><IMG id=oDIV<%=i%> style="DISPLAY: none;" height=220 src="<%=rst("bpic")%>" width=480 border=0></A> <% i=i+1 rst.movenext loop %> </DIV></TD> </TR> <TR vAlign=top align=middle height=25 bgcolor="#F7F7F7"> <TD width=82 ></TD> <TD width=26 height=19 ><A href="javascript:toggleTo(1)"><IMG id=A1_1 height=19 src="images/tu1_1.gif" width=26 border=0></A><A href="javascript:toggleTo(1)"><IMG id=A2_1 style="DISPLAY: none" height=19 src="images/tu1_2.gif" width=26 border=0></A></TD> <TD width=3></TD> <TD width=26 height=19><A href="javascript:toggleTo(2)"><IMG id=A2_2 height=19 src="images/tu2_2.gif" width=26 border=0></A><A href="javascript:toggleTo(2)"><IMG id=A1_2 style="DISPLAY: none" height=19 src="images/tu2_1.gif" width=26 border=0></A></TD> <TD width=3></TD> <TD width=26 height=19><A href="javascript:toggleTo(3)"><IMG id=A2_3 height=19 src="images/tu3_2.gif" width=26 border=0></A><A href="javascript:toggleTo(3)"><IMG id=A1_3 style="DISPLAY: none" height=19 src="images/tu3_1.gif" width=26 border=0></A></TD> <TD width=3></TD> <TD width=26 height=19><A href="javascript:toggleTo(4)"><IMG id=A2_4 height=19 src="images/tu4_2.gif" width=26 border=0></A><A href="javascript:toggleTo(4)"><IMG id=A1_4 style="DISPLAY: none" height=19 src="images/tu4_1.gif" width=26 border=0></A></TD> <TD width=82><% end if rst.close set rst=nothing %> </TD> </TR> </TBODY> </TABLE>TopImgToggle.js=================================================================================var NowImg = 1;var MaxImg = 4;var bStart = 0;var bStop =0;function fnToggle() {var next = NowImg + 1;if(next == MaxImg+1) {NowImg = MaxImg;next = 1;}if(bStop!=1){if(bStart == 0){bStart = 1; setTimeout('fnToggle()', 3000);return;}else{oTransContainer.filters[0].Apply();document.images['oDIV'+next].style.display = "";document.images['oDIV'+NowImg].style.display = "none"; oTransContainer.filters[0].Play(duration=2);if(NowImg == MaxImg) NowImg = 1;elseNowImg++;}setTimeout('fnToggle()', 3000);}}fnToggle();function toggleTo(img){bStop=1;if(img==1){document.images['oDIV1'].style.display = "";document.images['oDIV2'].style.display = "none"; document.images['oDIV3'].style.display = "none"; document.images['oDIV4'].style.display = "none"; document.images['A1_1'].style.display = ""; document.images['A2_1'].style.display = "none"; document.images['A1_2'].style.display = "none";document.images['A2_2'].style.display = "";document.images['A1_3'].style.display = "none";document.images['A2_3'].style.display = "";document.images['A1_4'].style.display = "none";document.images['A2_4'].style.display = "";}else if(img==2){document.images['oDIV2'].style.display = "";document.images['oDIV1'].style.display = "none"; document.images['oDIV3'].style.display = "none"; document.images['oDIV4'].style.display = "none"; document.images['A1_1'].style.display = "none"; document.images['A2_1'].style.display = ""; document.images['A1_2'].style.display = "";document.images['A2_2'].style.display = "none";document.images['A1_3'].style.display = "none";document.images['A2_3'].style.display = "";document.images['A1_4'].style.display = "none";document.images['A2_4'].style.display = "";}else if(img==3){document.images['oDIV3'].style.display = "";document.images['oDIV1'].style.display = "none"; document.images['oDIV2'].style.display = "none"; document.images['oDIV4'].style.display = "none"; document.images['A1_1'].style.display = "none"; document.images['A2_1'].style.display = ""; document.images['A1_2'].style.display = "none";document.images['A2_2'].style.display = "";document.images['A1_3'].style.display = "";document.images['A2_3'].style.display = "none";document.images['A1_4'].style.display = "none";document.images['A2_4'].style.display = "";}else if(img==4){document.images['oDIV4'].style.display = "";document.images['oDIV1'].style.display = "none"; document.images['oDIV2'].style.display = "none"; document.images['oDIV3'].style.display = "none"; document.images['A1_1'].style.display = "none"; document.images['A2_1'].style.display = ""; document.images['A1_2'].style.display = "none";document.images['A2_2'].style.display = "";document.images['A1_3'].style.display = "none";document.images['A2_3'].style.display = "";document.images['A1_4'].style.display = "";document.images['A2_4'].style.display = "none";}} 欢迎光监点石成金网 http://www.boxigroup.com 网站提供web开发(j2ee .net asp php javascript、c#等) c/s开发(delphi、vb、vc、pb、cb等) 数据库开发(oracle、sqlserver、db2、access、mysql、Postgresql、informix)等学习资料,希望能为你解决燃眉之急 ,请把本网站加入收藏夹,以备不时查询之需 bs+cs讨论群(9638134) 求助!!DHTMLX GRID 同一页面中需要多次使用到js广告轮播插件,只有第一个正常,请教哪里冲突了 神奇的读心术 ASP中如何将多行的查询结果转化成JSON字符串,JS这边又如何取值 各位同胞,帮下忙 请教如何判断客户端有没有鼠标键盘事件? 高手求救:window.opener提交后刷新原窗口有延时的问题? 怎样做到只有当页面装载完毕才能进行操作? 如何得到今天是星期几? 关于代替滚动条的问题??在线等待,谢谢! 发布一个日期选择控件 JavaScript如何根据数组的值来读取数组的下标呢?
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD><BODY>
<marquee id=mq1 direction=up >
<ul>
<li>昏睡百年,国人渐已醒
<li>睁开眼吧,小心看吧
<li>哪个愿臣虏自认
<li>因为畏缩与忍让
<li>人家骄气日盛
<li>开口叫吧,高声叫吧
<li>这里是全国皆兵
<li>历来强盗要侵入
<li>最终必送命
<li>万里长城永不到
<li>千里黄河水滔滔
<li>江山秀丽叠彩锋岭
<li>问我国家哪像染病
<li>冲开血路,挥手上吧
<li>要致力国家中兴
<li>岂让国土再遭践踏
<li>个个负起使命
<li>这睡狮已渐已醒
</ul>
</marquee>
<SCRIPT language=JavaScript>
function mq1stop(){
mq1.stop();
window.setTimeout("mq1start()",8000)
}
function mq1start(){
mq1.start();
window.setTimeout("mq1stop()",4000)
}
mq1start();
</SCRIPT>
</BODY>
</HTML>
http://ucren.com/DronFw/Example/ScrollBox.html<style type="text/css">
*
{
font-size:12px;
}
#scrollBox
{
width:250px;
height:20px;
line-height:20px;
overflow:hidden;
background-color:#eee;
}
#scrollBox2
{
width:280px;
height:60px;
line-height:20px;
overflow:hidden;
background-color:#eee;
}
</style>
单行例子:(每屏一行)<br><br>
<div id="scrollBox">
中国去年进口原油 11%来自上合成员<br />
美:中国对台湾立场 似转趋和缓<br />
美制裁四家中国公司 中方表示强烈不满<br />
中伊关系加温 大陆波斯餐厅开幕
</div><br>多行例子:(每屏三行)<br><br>
<div id="scrollBox2">
为何暂停UN登记武器转让 中方做解释<br>
追悼空军运输机遇难者 胡锦涛送花圈<br>
中国控制互联网?外交部发言人驳斥<br>
美国移民局逮2179人 包括1华人蛇头<br>
奇男子能嚼咽双刃刀片 用鼻子喝茶<br>
男子持塑料玩具枪 劫走四十多吨铜(图)<br>
餐馆当街宰小猫做肉丸 场面血腥(图)<br>
男子软禁妻子近5年 称是替其驱妖魔<br>
男子杀死同居女友 与腐尸共宿八天<br>
年轻妻子欲卖肾救夫 88篇日记感人<br>
曾志伟父亲节双喜临门 获美荣誉博士
</div><Script type="text/JavaScript">
//类内容
ScrollBox = function (uid)
{
this.scrollBox = document.getElementById(uid);
this.scrollBoxHeight = this.scrollBox.clientHeight;
this.scrollBoxInner = this.scrollBox.innerHTML;
this.scrollCol = this.scrolln = 0;
this.setScroll = function ()
{
this.scrollBox.scrollTop = this.scrollCol + this.scrolln;
if(this.scrolln==this.scrollBoxHeight)
return this.addScroll()
else
this.scrolln ++;
var o = this;
function m(){o.setScroll();}
setTimeout(m,20);
}
this.addScroll = function ()
{
this.scrollBox.innerHTML += "<br>" + this.scrollBoxInner;
this.scrollCol = this.scrollBox.scrollTop;
this.scrolln = 0;
var o = this;
function m(){o.setScroll();}
setTimeout(m,1000);
}
this.addScroll();
}//使用方法
new ScrollBox("scrollBox");
new ScrollBox("scrollBox2");
</Script>
===================================================================================
<SCRIPT language=JavaScript src="inc/TopImgToggle.js"></SCRIPT>
<%
sqlt="select top 4 id,bpic from tour order by id desc"
set rst=conn.execute(sqlt)
if not rst.eof then
i=1
%>
<TABLE width="100%" border=0 align="center" cellPadding=0 cellSpacing=0>
<TBODY>
<tr>
<td height="10" bgcolor="#F7F7F7" colspan="9"></td>
</tr>
<TR>
<TD colSpan="9" align="center" bgcolor="#F7F7F7"><DIV id=oTransContainer
style="FILTER: progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0, motion='forward'); WIDTH: 480px; HEIGHT: 220px">
<% do while not rst.eof %>
<A href="view.asp?id=<%=rst("id")%>" target=_blank><IMG id=oDIV<%=i%> style="DISPLAY: none;" height=220 src="<%=rst("bpic")%>" width=480 border=0></A>
<%
i=i+1
rst.movenext
loop
%>
</DIV></TD>
</TR>
<TR vAlign=top align=middle height=25 bgcolor="#F7F7F7">
<TD width=82 ></TD>
<TD width=26 height=19 ><A href="javascript:toggleTo(1)"><IMG id=A1_1
height=19 src="images/tu1_1.gif" width=26 border=0></A><A
href="javascript:toggleTo(1)"><IMG id=A2_1 style="DISPLAY: none"
height=19 src="images/tu1_2.gif" width=26 border=0></A></TD>
<TD width=3></TD>
<TD width=26 height=19><A href="javascript:toggleTo(2)"><IMG id=A2_2
height=19 src="images/tu2_2.gif" width=26 border=0></A><A
href="javascript:toggleTo(2)"><IMG id=A1_2 style="DISPLAY: none"
height=19 src="images/tu2_1.gif" width=26 border=0></A></TD>
<TD width=3></TD>
<TD width=26 height=19><A href="javascript:toggleTo(3)"><IMG id=A2_3
height=19 src="images/tu3_2.gif" width=26 border=0></A><A
href="javascript:toggleTo(3)"><IMG id=A1_3 style="DISPLAY: none"
height=19 src="images/tu3_1.gif" width=26 border=0></A></TD>
<TD width=3></TD>
<TD width=26 height=19><A href="javascript:toggleTo(4)"><IMG id=A2_4
height=19 src="images/tu4_2.gif" width=26 border=0></A><A
href="javascript:toggleTo(4)"><IMG id=A1_4 style="DISPLAY: none"
height=19 src="images/tu4_1.gif" width=26 border=0></A></TD>
<TD width=82><%
end if
rst.close
set rst=nothing
%>
</TD>
</TR>
</TBODY>
</TABLE>
TopImgToggle.js
=================================================================================
var NowImg = 1;
var MaxImg = 4;
var bStart = 0;
var bStop =0;function fnToggle() {
var next = NowImg + 1;if(next == MaxImg+1)
{
NowImg = MaxImg;
next = 1;
}
if(bStop!=1){if(bStart == 0)
{
bStart = 1;
setTimeout('fnToggle()', 3000);
return;
}
else
{
oTransContainer.filters[0].Apply();document.images['oDIV'+next].style.display = "";
document.images['oDIV'+NowImg].style.display = "none"; oTransContainer.filters[0].Play(duration=2);if(NowImg == MaxImg)
NowImg = 1;
else
NowImg++;
}
setTimeout('fnToggle()', 3000);
}
}fnToggle();function toggleTo(img){
bStop=1;if(img==1){
document.images['oDIV1'].style.display = "";
document.images['oDIV2'].style.display = "none";
document.images['oDIV3'].style.display = "none";
document.images['oDIV4'].style.display = "none";
document.images['A1_1'].style.display = "";
document.images['A2_1'].style.display = "none";
document.images['A1_2'].style.display = "none";
document.images['A2_2'].style.display = "";
document.images['A1_3'].style.display = "none";
document.images['A2_3'].style.display = "";
document.images['A1_4'].style.display = "none";
document.images['A2_4'].style.display = "";}else if(img==2){
document.images['oDIV2'].style.display = "";
document.images['oDIV1'].style.display = "none";
document.images['oDIV3'].style.display = "none";
document.images['oDIV4'].style.display = "none";
document.images['A1_1'].style.display = "none";
document.images['A2_1'].style.display = "";
document.images['A1_2'].style.display = "";
document.images['A2_2'].style.display = "none";
document.images['A1_3'].style.display = "none";
document.images['A2_3'].style.display = "";
document.images['A1_4'].style.display = "none";
document.images['A2_4'].style.display = "";
}else if(img==3){
document.images['oDIV3'].style.display = "";
document.images['oDIV1'].style.display = "none";
document.images['oDIV2'].style.display = "none";
document.images['oDIV4'].style.display = "none";
document.images['A1_1'].style.display = "none";
document.images['A2_1'].style.display = "";
document.images['A1_2'].style.display = "none";
document.images['A2_2'].style.display = "";
document.images['A1_3'].style.display = "";
document.images['A2_3'].style.display = "none";
document.images['A1_4'].style.display = "none";
document.images['A2_4'].style.display = "";
}else if(img==4){
document.images['oDIV4'].style.display = "";
document.images['oDIV1'].style.display = "none";
document.images['oDIV2'].style.display = "none";
document.images['oDIV3'].style.display = "none";
document.images['A1_1'].style.display = "none";
document.images['A2_1'].style.display = "";
document.images['A1_2'].style.display = "none";
document.images['A2_2'].style.display = "";
document.images['A1_3'].style.display = "none";
document.images['A2_3'].style.display = "";
document.images['A1_4'].style.display = "";
document.images['A2_4'].style.display = "none";
}}