发布网友 发布时间:2022-04-23 09:10
共2个回答
热心网友 时间:2023-10-09 03:25
以下的是横向滚动的
<div align="center">
<div id=demo style=overflow:hidden;height:93;width:98%;background:#F5F7FA;color:#ffffff>
<table align=left cellpadding=0 cellspace=0 border=0>
<tr>
<td id=demo1 valign=top><h3><a href="#"><img src="images/gun1.jpg" width="93" height="121" border="0"></a><a href="#"><img src="images/gun2.jpg" width="93" height="121" border="0"></a><a href="#"><img src="images/gun3.jpg" width="93" height="121" border="0"></a><a href="#"><img src="images/gun4.jpg" width="93" height="121" border="0"></a><a href="#"><img src="images/gun5.jpg" width="93" height="121" border="0"></a><a href="#"><img src="images/gun6.jpg" width="93" height="121" border="0"></a><a href="#"><img src="images/gun7.jpg" width="93" height="121" border="0"></a><a href="#"><img src="images/gun8.jpg" width="93" height="121" border="0"></a><a href="#"><img src="images/gun9.jpg" width="93" height="121" border="0"></a></h3></td>
<td id=demo2 valign=top></td>
</tr>
</table>
</div>
<script>
var speed=30
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>
</div>
你的布局跟我这不一样吧。你直接把我这个换上就可以用的
热心网友 时间:2023-10-09 03:25
以下的是横向滚动的
<div
align="center">
<div
id=demo
style=overflow:hidden;height:93;width:98%;background:#F5F7FA;color:#ffffff>
<table
align=left
cellpadding=0
cellspace=0
border=0>
<tr>
<td
id=demo1
valign=top><h3><a
href="#"><img
src="images/gun1.jpg"
width="93"
height="121"
border="0"></a><a
href="#"><img
src="images/gun2.jpg"
width="93"
height="121"
border="0"></a><a
href="#"><img
src="images/gun3.jpg"
width="93"
height="121"
border="0"></a><a
href="#"><img
src="images/gun4.jpg"
width="93"
height="121"
border="0"></a><a
href="#"><img
src="images/gun5.jpg"
width="93"
height="121"
border="0"></a><a
href="#"><img
src="images/gun6.jpg"
width="93"
height="121"
border="0"></a><a
href="#"><img
src="images/gun7.jpg"
width="93"
height="121"
border="0"></a><a
href="#"><img
src="images/gun8.jpg"
width="93"
height="121"
border="0"></a><a
href="#"><img
src="images/gun9.jpg"
width="93"
height="121"
border="0"></a></h3></td>
<td
id=demo2
valign=top></td>
</tr>
</table>
</div>
<script>
var
speed=30
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>
</div>
你的布局跟我这不一样吧。你直接把我这个换上就可以用的