如何把竖向滚动的图片变成横向滚动

发布网友 发布时间: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>
你的布局跟我这不一样吧。你直接把我这个换上就可以用的

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com