如何在HTML页面中实现图片循环滚动
我做了一个网页图片是从左至右循环的滚动,但是我做的前面跟后面没有衔接,滚玩后面是空白的,没有链接,以下是我做的,请教高人知道哪里出错。<divid="bodyer1_2n...
我做了一个网页图片是从左至右循环的滚动,但是我做的前面跟后面没有衔接,滚玩后面是空白的,没有链接,以下是我做的,请教高人知道哪里出错。
<div id="bodyer1_2n"><marquee onMouseOver="this.stop()" onMouseOut="this.start()" align=center direction=right scrollamount=8scrolldelay=3 valign=middle behavior="scroll" width="665" height="109">
<img border="0" src="image/t.jpg">
<img border="0" src="image/tt1.jpg">
<img border="0" src="image/tt2.jpg">
<img border="0" src="image/tp3.jpg">
<img border="0" src="image/tp4.jpg">
<img border="0" src="image/tt1.jpg">
</marquee>
</div>
楼下的回答好复杂,可不可以简单解释清楚些 展开
<div id="bodyer1_2n"><marquee onMouseOver="this.stop()" onMouseOut="this.start()" align=center direction=right scrollamount=8scrolldelay=3 valign=middle behavior="scroll" width="665" height="109">
<img border="0" src="image/t.jpg">
<img border="0" src="image/tt1.jpg">
<img border="0" src="image/tt2.jpg">
<img border="0" src="image/tp3.jpg">
<img border="0" src="image/tp4.jpg">
<img border="0" src="image/tt1.jpg">
</marquee>
</div>
楼下的回答好复杂,可不可以简单解释清楚些 展开
2个回答
展开全部
<DIV id=demo style="OVERFLOW: hidden; WIDTH: 600px; HEIGHT: 190px; top:485px; left:252px;position: absolute;">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" id=demo1>
<!-- 要循环滚动的图片 -->
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td width="200" align="center" style="height: 151px">
<a href="WebDeSign.aspx">
<img src="images/indexpic1.gif" width="194" height="147" border="0" /></a>
</td>
<td width="200" align="center" style="height: 151px">
<a href="SoftWare.aspx">
<img src="images/indexpic2.gif" width="194" height="147" border="0" /></a>
</td>
<td align="center" style="height: 151px; width: 200px;">
<a href="VhostIndex.aspx">
<img src="images/indexpic3.gif" width="194" height="147" border="0" /></a>
</td>
</tr>
</table>
</td>
<TD id=demo2 width=1></TD>
</tr>
</table>
</DIV>
<SCRIPT>
var speed=30//速度数值越大速度越慢
var demo2 = document.getElementById("demo2");
var demo = document.getElementById("demo");
var demo1 = document.getElementById("demo1");
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>
自己站的效果
你可以访问 http://b1.gd.cn
希望对你有帮助。。(*^__^*)
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" id=demo1>
<!-- 要循环滚动的图片 -->
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td width="200" align="center" style="height: 151px">
<a href="WebDeSign.aspx">
<img src="images/indexpic1.gif" width="194" height="147" border="0" /></a>
</td>
<td width="200" align="center" style="height: 151px">
<a href="SoftWare.aspx">
<img src="images/indexpic2.gif" width="194" height="147" border="0" /></a>
</td>
<td align="center" style="height: 151px; width: 200px;">
<a href="VhostIndex.aspx">
<img src="images/indexpic3.gif" width="194" height="147" border="0" /></a>
</td>
</tr>
</table>
</td>
<TD id=demo2 width=1></TD>
</tr>
</table>
</DIV>
<SCRIPT>
var speed=30//速度数值越大速度越慢
var demo2 = document.getElementById("demo2");
var demo = document.getElementById("demo");
var demo1 = document.getElementById("demo1");
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>
自己站的效果
你可以访问 http://b1.gd.cn
希望对你有帮助。。(*^__^*)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询