- 浏览: 16586 次
- 性别:
- 来自: 北京
文章分类
最新评论
javascript实现走马灯效果[无缝连接、循环滚动、无空白maquee]
以下代码在IE6、Firefox+Win2k环境下测试通过
一、向上的无缝循环滚动
程序代码: [ 复制代码到剪贴板 ]
<!-- 指向链接图片的URL -->
<base href="http://www.it365cn.com">
<div align="center" id="demo" style="overflow:hidden;height:200px;width:95px;border-width:1px 1px 1px 1px;border-style:dotted dotted dotted dotted;">
<div id="demo1">
<!-- 定义内容-->
<img src="images/logo_1.gif">
<img src="images/logo/flashempire.gif">
<img src="images/logo.gif">
<img src="images/logo/5dmedia.gif">
<img src="images/logo/macromedia.gif">
<img src="images/logo/sucaiw.gif">
<img src="images/logo/blueieda.gif">
<img src="images/logo/htmlcn.gif">
<img src="images/logo/fwcn.gif">
</div>
<div id="demo2"></div>
</div>
<script language="javascript" type="text/javascript">
<!--
var demo = document.getElementById("demo");
var demo1 = document.getElementById("demo1");
var demo2 = document.getElementById("demo2");
var speed=10; //滚动速度值,值越大速度越慢
demo2.innerHTML = demo1.innerHTML //克隆demo2为demo1
function Marquee(){
if(demo2.offsetTop-demo.scrollTop<=0) //当滚动至demo1与demo2交界时
demo.scrollTop-=demo1.offsetHeight //demo跳到最顶端
else{
demo.scrollTop++
}
}
var MyMar = setInterval(Marquee,speed); //设置定时器
demo.onmouseover = function(){clearInterval(MyMar)} //鼠标经过时清除定时器达到滚动停止的目的
demo.onmouseout = function(){MyMar = setInterval(Marquee,speed)} //鼠标移开时重设定时器
-->
</script>
二、向下的无缝循环滚动
程序代码: [ 复制代码到剪贴板 ]
<!-- 指向链接图片的URL -->
<base href="http://www.it365cn.com">
<div align="center" id="demo" style="overflow:hidden;height:200px;width:95px;border-width:1px 1px 1px 1px;border-style:dotted dotted dotted dotted;">
<div id="demo1">
<!-- 定义内容-->
<img src="images/logo_1.gif">
<img src="images/logo/flashempire.gif">
<img src="images/logo.gif">
<img src="images/logo/5dmedia.gif">
<img src="images/logo/macromedia.gif">
<img src="images/logo/sucaiw.gif">
<img src="images/logo/blueieda.gif">
<img src="images/logo/htmlcn.gif">
<img src="images/logo/fwcn.gif">
</div>
<div id="demo2"></div>
</div>
<script language="javascript" type="text/javascript">
<!--
var demo = document.getElementById("demo");
var demo1 = document.getElementById("demo1");
var demo2 = document.getElementById("demo2");
var speed=10; //数值越大滚动速度越慢
demo2.innerHTML = demo1.innerHTML;
demo.scrollTop = demo.scrollHeight;
function Marquee(){
if(demo1.offsetTop-demo.scrollTop>=0)
demo.scrollTop+=demo2.offsetHeight
else{
demo.scrollTop--
}
}
var MyMar = setInterval(Marquee,speed);
demo.onmouseover = function(){clearInterval(MyMar)}
demo.onmouseout = function(){MyMar = setInterval(Marquee,speed)}
-->
</script>
三、向左的无缝循环滚动
程序代码: [ 复制代码到剪贴板 ]
<!-- 指向链接图片的URL -->
<base href="http://www.it365cn.com">
<div align="center" id="demo" style="overflow:hidden;height:33px;width:500px;border-width:1px 1px 1px 1px;border-style:dotted dotted dotted dotted;">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td id="demo1"><img src="images/logo_1.gif"><img src="images/logo/flashempire.gif"><img src="images/logo.gif"><img src="images/logo/5dmedia.gif"><img src="images/logo/macromedia.gif"><img src="images/logo/sucaiw.gif"><img src="images/logo/blueieda.gif"><img src="images/logo/htmlcn.gif" border="0"></td>
<td id="demo2"> </td>
</tr>
</table>
</div>
<script language="javascript" type="text/javascript">
<!--
var demo = document.getElementById("demo");
var demo1 = document.getElementById("demo1");
var demo2 = document.getElementById("demo2");
var speed=10; //数值越大滚动速度越慢
demo2.innerHTML = demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar = setInterval(Marquee,speed);
demo.onmouseover = function(){clearInterval(MyMar)}
demo.onmouseout = function(){MyMar = setInterval(Marquee,speed)}
-->
</script>
四、向右的无缝循环滚动
程序代码: [ 复制代码到剪贴板 ]
<!-- 指向链接图片的URL -->
<base href="http://www.it365cn.com">
<div align="center" id="demo" style="overflow:hidden;height:33px;width:500px;border-width:1px 1px 1px 1px;border-style:dotted dotted dotted dotted;">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td id="demo1"><img src="images/logo_1.gif"><img src="images/logo/flashempire.gif"><img src="images/logo.gif"><img src="images/logo/5dmedia.gif"><img src="images/logo/macromedia.gif"><img src="images/logo/sucaiw.gif"><img src="images/logo/blueieda.gif"><img src="images/logo/htmlcn.gif" border="0"></td>
<td id="demo2"> </td>
</tr>
</table>
</div>
<script language="javascript" type="text/javascript">
<!--
var demo = document.getElementById("demo");
var demo1 = document.getElementById("demo1");
var demo2 = document.getElementById("demo2");
var speed=10; //数值越大滚动速度越慢
demo2.innerHTML = demo1.innerHTML;
demo.scrollLeft = demo.scrollWidth;
function Marquee(){
if(demo.scrollLeft<=0)
demo.scrollLeft+=demo2.offsetWidth
else{
demo.scrollLeft--
}
}
var MyMar = setInterval(Marquee,speed)
demo.onmouseover = function(){clearInterval(MyMar)}
demo.onmouseout = function(){MyMar = setInterval(Marquee,speed)}
-->
</script>
来源:http://thomaslee007.javaeye.com/blog/204708
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
上下綜合實例
<a href="#" onmouseover="addspeed=10" onmouseout="addspeed=dafault_addspeed" >^^^^^^^^^^^^^^^^^^^^^^^^</a>
<div id=demo style="overflow:hidden;height:421px;width:190px;">
<div id="demo1">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="421" align="center">
<table width="95%" border="0" cellspacing="7" cellpadding="0">
<tr>
<td align="center"><a href="main.php?action=introduce_view&id=1"><img src="http://qz/upload/2008/12/20081216101239_small.jpg" width="180" height="73" border="0" /></a></td>
</tr>
<tr>
<td align="center"><a href="main.php?action=introduce_view&id=2"><img src="http://qz/upload/2008/12/20081216101251_small.jpg" width="180" height="73" border="0" /></a></td>
</tr>
<tr>
<td align="center"><a href="main.php?action=introduce_view&id=1"><img src="http://qz/upload/2008/12/20081216101239_small.jpg" width="180" height="73" border="0" /></a></td>
</tr>
<tr>
<td align="center"><a href="main.php?action=introduce_view&id=2"><img src="http://qz/upload/2008/12/20081216101251_small.jpg" width="180" height="73" border="0" /></a></td>
</tr>
</table></td>
</tr>
</table>
</div>
<div id="demo2"></div>
</div>
<a href="#" onmouseover="clearInterval(MyMar);MyMar=setInterval(rightAddSpeed,speed)" onmouseout="clearInterval(MyMar);MyMar=setInterval(Marquee,speed)" >ⅤⅤⅤⅤⅤⅤⅤⅤⅤⅤⅤⅤ</a>
<script>
var speed=1 ;
var addspeed=1;
var dafault_addspeed=1;
var demo = document.getElementById("demo");
var demo1 = document.getElementById("demo1");
var demo2 = document.getElementById("demo2");
demo2.innerHTML=demo1.innerHTML ;
function Marquee(){
if(demo2.offsetHeight-demo.scrollTop<=0)
demo.scrollTop-=demo1.offsetHeight;
else{
demo.scrollTop=demo.scrollTop+addspeed;
}
}
function rightAddSpeed(){
if(demo1.offsetTop-demo.scrollTop>=0)
demo.scrollTop+=demo2.offsetHeight
else{
demo.scrollTop-=10;
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
=================================================
+++++++++++++++左右綜合实例++++++++++++++
<table width="1002" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="153" valign="top" background="images/pro_centerbg2.jpg"><table width="1002" height="140" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="106" align="center" valign="top"><img src="images/jiantou_left.jpg" width="60" height="88" onmouseover="addspeed=10" onmouseout="addspeed=dafault_addspeed"/></td>
<td width="790" valign="top">
<!----------------------------小圖展示區------------------------------------>
<div id=demo style="overflow:hidden;height:100px;width:790px;">
<table>
<tr>
<td id="demo1" valign="top">
<table width="790" height="140" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="131" align="center" valign="top" >
<DIV class="example" style="width:130px; ">
<!--[if lte IE 6.5]><v:rect filled="f"><v:fill size="0pt,0pt"></v:fill><![endif]-->
<DIV class="bd" style="width:110px; height:74px;">
<img src="images/protest1.jpg" width="110" height="74" /></DIV>
<!--[if lte IE 6.5]></v:rect><![endif]-->
</DIV>
</td>
<td width="131" align="center" valign="top" >
<DIV class="example" style="width:130px; ">
<!--[if lte IE 6.5]><v:rect filled="f"><v:fill size="0pt,0pt"></v:fill><![endif]-->
<DIV class="bd" style="width:110px; height:74px;">
<img src="images/protest2.jpg" width="110" height="74" /></DIV>
<!--[if lte IE 6.5]></v:rect><![endif]-->
</DIV>
</td>
<td width="131" align="center" valign="top">
<DIV class="example" style="width:130px; ">
<!--[if lte IE 6.5]><v:rect filled="f"><v:fill size="0pt,0pt"></v:fill><![endif]-->
<DIV class="bd" style="width:110px; height:74px;">
<img src="images/protest3.jpg" width="110" height="74" /></DIV>
<!--[if lte IE 6.5]></v:rect><![endif]-->
</DIV>
</td>
<td width="131" align="center" valign="top">
<DIV class="example" style="width:130px; ">
<!--[if lte IE 6.5]><v:rect filled="f"><v:fill size="0pt,0pt"></v:fill><![endif]-->
<DIV class="bd" style="width:110px; height:74px;">
<img src="images/protest4.jpg" width="110" height="74" /></DIV>
<!--[if lte IE 6.5]></v:rect><![endif]-->
</DIV>
</td>
<td width="131" align="center" valign="top">
<DIV class="example" style="width:130px; ">
<!--[if lte IE 6.5]><v:rect filled="f"><v:fill size="0pt,0pt"></v:fill><![endif]-->
<DIV class="bd" style="width:110px; height:74px;">
<img src="images/protest5.jpg" width="110" height="74" /></DIV>
<!--[if lte IE 6.5]></v:rect><![endif]-->
</DIV>
</td>
<td width="135" align="center" valign="top">
<DIV class="example" style="width:130px; ">
<!--[if lte IE 6.5]><v:rect filled="f"><v:fill size="0pt,0pt"></v:fill><![endif]-->
<DIV class="bd" style="width:110px; height:74px;">
<img src="images/protest6.jpg" width="110" height="74" /></DIV>
<!--[if lte IE 6.5]></v:rect><![endif]-->
</DIV>
</td>
<td width="135" align="center" valign="top">
<DIV class="example" style="width:130px; ">
<!--[if lte IE 6.5]><v:rect filled="f"><v:fill size="0pt,0pt"></v:fill><![endif]-->
<DIV class="bd" style="width:110px; height:74px;">
<img src="images/protest6.jpg" width="110" height="74" /></DIV>
<!--[if lte IE 6.5]></v:rect><![endif]-->
</DIV>
</td>
</tr>
</table>
</td>
<td valign="top" id="demo2"></td>
</tr>
</table>
</div>
<!----------------------------小圖展示區end------------------------------------>
</td>
<td width="106" align="center" valign="top"><img src="images/jiantou_right.jpg" width="60" height="88" onmouseover="clearInterval(MyMar);MyMar=setInterval(rightAddSpeed,speed)" onmouseout="clearInterval(MyMar);MyMar=setInterval(Marquee,speed)"/></td>
</tr>
</table></td>
</tr>
</table>
<script>
var speed=1
var addspeed=1;
var dafault_addspeed=1;
var demo = document.getElementById("demo");
var demo1 = document.getElementById("demo1");
var demo2 = document.getElementById("demo2");
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft=demo.scrollLeft+addspeed
}
}
function rightAddSpeed(){
if(demo2.offsetWidth-demo.scrollLeft>0)
demo.scrollLeft+=demo1.offsetWidth
else{
demo.scrollLeft=demo.scrollLeft-10
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
一、向上的无缝循环滚动
程序代码: [ 复制代码到剪贴板 ]
<!-- 指向链接图片的URL -->
<base href="http://www.it365cn.com">
<div align="center" id="demo" style="overflow:hidden;height:200px;width:95px;border-width:1px 1px 1px 1px;border-style:dotted dotted dotted dotted;">
<div id="demo1">
<!-- 定义内容-->
<img src="images/logo_1.gif">
<img src="images/logo/flashempire.gif">
<img src="images/logo.gif">
<img src="images/logo/5dmedia.gif">
<img src="images/logo/macromedia.gif">
<img src="images/logo/sucaiw.gif">
<img src="images/logo/blueieda.gif">
<img src="images/logo/htmlcn.gif">
<img src="images/logo/fwcn.gif">
</div>
<div id="demo2"></div>
</div>
<script language="javascript" type="text/javascript">
<!--
var demo = document.getElementById("demo");
var demo1 = document.getElementById("demo1");
var demo2 = document.getElementById("demo2");
var speed=10; //滚动速度值,值越大速度越慢
demo2.innerHTML = demo1.innerHTML //克隆demo2为demo1
function Marquee(){
if(demo2.offsetTop-demo.scrollTop<=0) //当滚动至demo1与demo2交界时
demo.scrollTop-=demo1.offsetHeight //demo跳到最顶端
else{
demo.scrollTop++
}
}
var MyMar = setInterval(Marquee,speed); //设置定时器
demo.onmouseover = function(){clearInterval(MyMar)} //鼠标经过时清除定时器达到滚动停止的目的
demo.onmouseout = function(){MyMar = setInterval(Marquee,speed)} //鼠标移开时重设定时器
-->
</script>
二、向下的无缝循环滚动
程序代码: [ 复制代码到剪贴板 ]
<!-- 指向链接图片的URL -->
<base href="http://www.it365cn.com">
<div align="center" id="demo" style="overflow:hidden;height:200px;width:95px;border-width:1px 1px 1px 1px;border-style:dotted dotted dotted dotted;">
<div id="demo1">
<!-- 定义内容-->
<img src="images/logo_1.gif">
<img src="images/logo/flashempire.gif">
<img src="images/logo.gif">
<img src="images/logo/5dmedia.gif">
<img src="images/logo/macromedia.gif">
<img src="images/logo/sucaiw.gif">
<img src="images/logo/blueieda.gif">
<img src="images/logo/htmlcn.gif">
<img src="images/logo/fwcn.gif">
</div>
<div id="demo2"></div>
</div>
<script language="javascript" type="text/javascript">
<!--
var demo = document.getElementById("demo");
var demo1 = document.getElementById("demo1");
var demo2 = document.getElementById("demo2");
var speed=10; //数值越大滚动速度越慢
demo2.innerHTML = demo1.innerHTML;
demo.scrollTop = demo.scrollHeight;
function Marquee(){
if(demo1.offsetTop-demo.scrollTop>=0)
demo.scrollTop+=demo2.offsetHeight
else{
demo.scrollTop--
}
}
var MyMar = setInterval(Marquee,speed);
demo.onmouseover = function(){clearInterval(MyMar)}
demo.onmouseout = function(){MyMar = setInterval(Marquee,speed)}
-->
</script>
三、向左的无缝循环滚动
程序代码: [ 复制代码到剪贴板 ]
<!-- 指向链接图片的URL -->
<base href="http://www.it365cn.com">
<div align="center" id="demo" style="overflow:hidden;height:33px;width:500px;border-width:1px 1px 1px 1px;border-style:dotted dotted dotted dotted;">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td id="demo1"><img src="images/logo_1.gif"><img src="images/logo/flashempire.gif"><img src="images/logo.gif"><img src="images/logo/5dmedia.gif"><img src="images/logo/macromedia.gif"><img src="images/logo/sucaiw.gif"><img src="images/logo/blueieda.gif"><img src="images/logo/htmlcn.gif" border="0"></td>
<td id="demo2"> </td>
</tr>
</table>
</div>
<script language="javascript" type="text/javascript">
<!--
var demo = document.getElementById("demo");
var demo1 = document.getElementById("demo1");
var demo2 = document.getElementById("demo2");
var speed=10; //数值越大滚动速度越慢
demo2.innerHTML = demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar = setInterval(Marquee,speed);
demo.onmouseover = function(){clearInterval(MyMar)}
demo.onmouseout = function(){MyMar = setInterval(Marquee,speed)}
-->
</script>
四、向右的无缝循环滚动
程序代码: [ 复制代码到剪贴板 ]
<!-- 指向链接图片的URL -->
<base href="http://www.it365cn.com">
<div align="center" id="demo" style="overflow:hidden;height:33px;width:500px;border-width:1px 1px 1px 1px;border-style:dotted dotted dotted dotted;">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td id="demo1"><img src="images/logo_1.gif"><img src="images/logo/flashempire.gif"><img src="images/logo.gif"><img src="images/logo/5dmedia.gif"><img src="images/logo/macromedia.gif"><img src="images/logo/sucaiw.gif"><img src="images/logo/blueieda.gif"><img src="images/logo/htmlcn.gif" border="0"></td>
<td id="demo2"> </td>
</tr>
</table>
</div>
<script language="javascript" type="text/javascript">
<!--
var demo = document.getElementById("demo");
var demo1 = document.getElementById("demo1");
var demo2 = document.getElementById("demo2");
var speed=10; //数值越大滚动速度越慢
demo2.innerHTML = demo1.innerHTML;
demo.scrollLeft = demo.scrollWidth;
function Marquee(){
if(demo.scrollLeft<=0)
demo.scrollLeft+=demo2.offsetWidth
else{
demo.scrollLeft--
}
}
var MyMar = setInterval(Marquee,speed)
demo.onmouseover = function(){clearInterval(MyMar)}
demo.onmouseout = function(){MyMar = setInterval(Marquee,speed)}
-->
</script>
来源:http://thomaslee007.javaeye.com/blog/204708
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
上下綜合實例
<a href="#" onmouseover="addspeed=10" onmouseout="addspeed=dafault_addspeed" >^^^^^^^^^^^^^^^^^^^^^^^^</a>
<div id=demo style="overflow:hidden;height:421px;width:190px;">
<div id="demo1">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="421" align="center">
<table width="95%" border="0" cellspacing="7" cellpadding="0">
<tr>
<td align="center"><a href="main.php?action=introduce_view&id=1"><img src="http://qz/upload/2008/12/20081216101239_small.jpg" width="180" height="73" border="0" /></a></td>
</tr>
<tr>
<td align="center"><a href="main.php?action=introduce_view&id=2"><img src="http://qz/upload/2008/12/20081216101251_small.jpg" width="180" height="73" border="0" /></a></td>
</tr>
<tr>
<td align="center"><a href="main.php?action=introduce_view&id=1"><img src="http://qz/upload/2008/12/20081216101239_small.jpg" width="180" height="73" border="0" /></a></td>
</tr>
<tr>
<td align="center"><a href="main.php?action=introduce_view&id=2"><img src="http://qz/upload/2008/12/20081216101251_small.jpg" width="180" height="73" border="0" /></a></td>
</tr>
</table></td>
</tr>
</table>
</div>
<div id="demo2"></div>
</div>
<a href="#" onmouseover="clearInterval(MyMar);MyMar=setInterval(rightAddSpeed,speed)" onmouseout="clearInterval(MyMar);MyMar=setInterval(Marquee,speed)" >ⅤⅤⅤⅤⅤⅤⅤⅤⅤⅤⅤⅤ</a>
<script>
var speed=1 ;
var addspeed=1;
var dafault_addspeed=1;
var demo = document.getElementById("demo");
var demo1 = document.getElementById("demo1");
var demo2 = document.getElementById("demo2");
demo2.innerHTML=demo1.innerHTML ;
function Marquee(){
if(demo2.offsetHeight-demo.scrollTop<=0)
demo.scrollTop-=demo1.offsetHeight;
else{
demo.scrollTop=demo.scrollTop+addspeed;
}
}
function rightAddSpeed(){
if(demo1.offsetTop-demo.scrollTop>=0)
demo.scrollTop+=demo2.offsetHeight
else{
demo.scrollTop-=10;
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
=================================================
+++++++++++++++左右綜合实例++++++++++++++
<table width="1002" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="153" valign="top" background="images/pro_centerbg2.jpg"><table width="1002" height="140" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="106" align="center" valign="top"><img src="images/jiantou_left.jpg" width="60" height="88" onmouseover="addspeed=10" onmouseout="addspeed=dafault_addspeed"/></td>
<td width="790" valign="top">
<!----------------------------小圖展示區------------------------------------>
<div id=demo style="overflow:hidden;height:100px;width:790px;">
<table>
<tr>
<td id="demo1" valign="top">
<table width="790" height="140" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="131" align="center" valign="top" >
<DIV class="example" style="width:130px; ">
<!--[if lte IE 6.5]><v:rect filled="f"><v:fill size="0pt,0pt"></v:fill><![endif]-->
<DIV class="bd" style="width:110px; height:74px;">
<img src="images/protest1.jpg" width="110" height="74" /></DIV>
<!--[if lte IE 6.5]></v:rect><![endif]-->
</DIV>
</td>
<td width="131" align="center" valign="top" >
<DIV class="example" style="width:130px; ">
<!--[if lte IE 6.5]><v:rect filled="f"><v:fill size="0pt,0pt"></v:fill><![endif]-->
<DIV class="bd" style="width:110px; height:74px;">
<img src="images/protest2.jpg" width="110" height="74" /></DIV>
<!--[if lte IE 6.5]></v:rect><![endif]-->
</DIV>
</td>
<td width="131" align="center" valign="top">
<DIV class="example" style="width:130px; ">
<!--[if lte IE 6.5]><v:rect filled="f"><v:fill size="0pt,0pt"></v:fill><![endif]-->
<DIV class="bd" style="width:110px; height:74px;">
<img src="images/protest3.jpg" width="110" height="74" /></DIV>
<!--[if lte IE 6.5]></v:rect><![endif]-->
</DIV>
</td>
<td width="131" align="center" valign="top">
<DIV class="example" style="width:130px; ">
<!--[if lte IE 6.5]><v:rect filled="f"><v:fill size="0pt,0pt"></v:fill><![endif]-->
<DIV class="bd" style="width:110px; height:74px;">
<img src="images/protest4.jpg" width="110" height="74" /></DIV>
<!--[if lte IE 6.5]></v:rect><![endif]-->
</DIV>
</td>
<td width="131" align="center" valign="top">
<DIV class="example" style="width:130px; ">
<!--[if lte IE 6.5]><v:rect filled="f"><v:fill size="0pt,0pt"></v:fill><![endif]-->
<DIV class="bd" style="width:110px; height:74px;">
<img src="images/protest5.jpg" width="110" height="74" /></DIV>
<!--[if lte IE 6.5]></v:rect><![endif]-->
</DIV>
</td>
<td width="135" align="center" valign="top">
<DIV class="example" style="width:130px; ">
<!--[if lte IE 6.5]><v:rect filled="f"><v:fill size="0pt,0pt"></v:fill><![endif]-->
<DIV class="bd" style="width:110px; height:74px;">
<img src="images/protest6.jpg" width="110" height="74" /></DIV>
<!--[if lte IE 6.5]></v:rect><![endif]-->
</DIV>
</td>
<td width="135" align="center" valign="top">
<DIV class="example" style="width:130px; ">
<!--[if lte IE 6.5]><v:rect filled="f"><v:fill size="0pt,0pt"></v:fill><![endif]-->
<DIV class="bd" style="width:110px; height:74px;">
<img src="images/protest6.jpg" width="110" height="74" /></DIV>
<!--[if lte IE 6.5]></v:rect><![endif]-->
</DIV>
</td>
</tr>
</table>
</td>
<td valign="top" id="demo2"></td>
</tr>
</table>
</div>
<!----------------------------小圖展示區end------------------------------------>
</td>
<td width="106" align="center" valign="top"><img src="images/jiantou_right.jpg" width="60" height="88" onmouseover="clearInterval(MyMar);MyMar=setInterval(rightAddSpeed,speed)" onmouseout="clearInterval(MyMar);MyMar=setInterval(Marquee,speed)"/></td>
</tr>
</table></td>
</tr>
</table>
<script>
var speed=1
var addspeed=1;
var dafault_addspeed=1;
var demo = document.getElementById("demo");
var demo1 = document.getElementById("demo1");
var demo2 = document.getElementById("demo2");
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft=demo.scrollLeft+addspeed
}
}
function rightAddSpeed(){
if(demo2.offsetWidth-demo.scrollLeft>0)
demo.scrollLeft+=demo1.offsetWidth
else{
demo.scrollLeft=demo.scrollLeft-10
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
相关推荐
5. 判断当滚动条到达指定内容宽度时,将内容追加到元素的末尾,实现循环滚动。 6. 通过setInterval函数设置scroll函数定时执行,以达到连续滚动的效果。 在实际项目中,推荐使用第二种方法,因为其可定制性更高,...
通过研究源码,可以了解如何使用编程语言(如JavaScript、Python等)结合数据可视化库来创建复杂的可视化界面,以及如何实现数据的动态加载和交互功能。 5. 可演示特性:此DEMO源码是可演示的,意味着它可以作为一...
ECharts是一个基于JavaScript的数据可视化库,它充分利用了HTML5的Canvas或SVG进行图表渲染。ECharts提供了丰富的图表类型,包括折线图、柱状图、饼图、散点图、K线图等,能够满足各种数据分析和展示需求。此外,...
特征 这是vue专有的选取框组件,其特征是无限的上下旋转木马,将首尾相连。 用法 安装 npm i @ vue_modules / vue - marquee - straight 基本的 ...import TheMarquee from "@vue_modules/vue-marquee-straight" ;...
基于springboot大学生就业信息管理系统源码数据库文档.zip
基于java的驾校收支管理可视化平台的开题报告
时间序列 原木 间隔5秒钟 20241120
毕业设计&课设_基于 Vue 的电影在线预订与管理系统:后台 Java(SSM)代码,为毕业设计项目.zip
基于springboot课件通中小学教学课件共享平台源码数据库文档.zip
基于java的网上购物商城的开题报告
Delphi人脸检测与识别Demo1fdef-main.zip
基于java的咖啡在线销售系统的开题报告
基于java的自助医疗服务系统的开题报告.docx
内容概要:本文档全面介绍了Visual Basic(VB)编程语言的基础知识和高级应用。首先概述了VB的基本特性和开发环境,随后详细讲述了VB的数据类型、变量、运算符、控制结构、数组、过程与函数、变量作用域等内容。接着介绍了窗体设计、控件使用、菜单与工具栏的设计,文件操作、数据库访问等关键知识点。最后讨论了VB的学习方法、发展历史及其在桌面应用、Web应用、数据库应用、游戏开发和自动化脚本编写等领域的广泛应用前景。 适合人群:初学者和中级程序员,尤其是希望快速掌握Windows桌面应用开发的人群。 使用场景及目标:①掌握VB的基础语法和开发环境;②学会使用VB创建复杂的用户界面和功能完整的应用程序;③理解数据库操作、文件管理和网络编程等高级主题。 其他说明:Visual Basic是一种简单易学且功能强大的编程语言,尤其适合用于开发Windows桌面应用。文中不仅覆盖了基础知识,还包括了大量的实用案例和技术细节,帮助读者快速提升编程技能。
基于java的疫情期间高校防控系统开题报告.docx
基于springboot+vue社区老年人帮扶系统源码数据库文档.zip
基于java的超市商品管理系统的开题报告.docx
基于SpringBoot房屋买卖平台源码数据库文档.zip
xdu限通院23微处理器系统与应用大作业(两只老虎),适应于汇编语言keil软件,
<项目介绍> - 新闻类网站系统,基于SSM(Spring、Spring MVC、MyBatis)+MySQL开发,高分成品毕业设计,附带往届论文 - 不懂运行,下载完可以私聊问,可远程教学 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。 --------