...自动滚动图片,但不知道代码该放在那里,请高手帮忙一下
发布网友
发布时间:2024-10-01 02:27
我来回答
共2个回答
热心网友
时间:2024-10-06 03:36
无缝隙滚动代码 自己看看就明白了 非常简单 <style>
#demoa {
overflow:hidden;
width: 690px;
}
#demoa img {
}
#indemoa {
float: left;
width: 800%;
}
#demoa1 {
float: left;
}
#demoa2 {
float: left;
}
</style>
<div id="demoa">
<div id="indemoa">
<div id="demoa1">
<div>
<img src="image/dh.png">
<img src="image/hs.png">
<img src="image/wsg.png">
<img src="image/xh.png">
<img src="image/ibm.gif">
<img src="image/gsdx.gif">
<div class="clear"></div>
</div>
</div>
<div id="demoa2">
<div>
<img src="image/dh.png">
<img src="image/hs.png">
<img src="images/wsg.png">
<img src="images/xh.png">
<img src="image/ibm.gif">
<img src="image/gsdx.gif">
<div class="clear"></div>
</div>
</div>
</div>
<script>
<!--
var speed=50;
var tab=document.getElementById("demoa");
var tab1=document.getElementById("demoa1");
var tab2=document.getElementById("demoa2");
tab2.innerHTML=tab1.innerHTML;
function Marquee(){
if(tab2.offsetWidth-tab.scrollLeft<=0)
tab.scrollLeft-=tab1.offsetWidth
else{
tab.scrollLeft++;
}
}
var MyMar=setInterval(Marquee,speed);
tab.onmouseover=function() {clearInterval(MyMar)};
tab.onmouseout=function() {MyMar=setInterval(Marquee,speed)};
-->
</script>
热心网友
时间:2024-10-06 03:36
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <html xmlns=""> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>marquee标签设置文字滚动 </title> <style type="text/css"> body{ margin:0; border:0; padding:0;} #div{ width:400px; height:300px; background-image:url();} </style> </head> <body> <div id="div" ><marquee behavior="alternate">marquee标签设置文字滚动 </marquee> </div> </body> </html>~
热心网友
时间:2024-10-06 03:34
无缝隙滚动代码 自己看看就明白了 非常简单 <style>
#demoa {
overflow:hidden;
width: 690px;
}
#demoa img {
}
#indemoa {
float: left;
width: 800%;
}
#demoa1 {
float: left;
}
#demoa2 {
float: left;
}
</style>
<div id="demoa">
<div id="indemoa">
<div id="demoa1">
<div>
<img src="image/dh.png">
<img src="image/hs.png">
<img src="image/wsg.png">
<img src="image/xh.png">
<img src="image/ibm.gif">
<img src="image/gsdx.gif">
<div class="clear"></div>
</div>
</div>
<div id="demoa2">
<div>
<img src="image/dh.png">
<img src="image/hs.png">
<img src="images/wsg.png">
<img src="images/xh.png">
<img src="image/ibm.gif">
<img src="image/gsdx.gif">
<div class="clear"></div>
</div>
</div>
</div>
<script>
<!--
var speed=50;
var tab=document.getElementById("demoa");
var tab1=document.getElementById("demoa1");
var tab2=document.getElementById("demoa2");
tab2.innerHTML=tab1.innerHTML;
function Marquee(){
if(tab2.offsetWidth-tab.scrollLeft<=0)
tab.scrollLeft-=tab1.offsetWidth
else{
tab.scrollLeft++;
}
}
var MyMar=setInterval(Marquee,speed);
tab.onmouseover=function() {clearInterval(MyMar)};
tab.onmouseout=function() {MyMar=setInterval(Marquee,speed)};
-->
</script>
热心网友
时间:2024-10-06 03:39
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <html xmlns=""> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>marquee标签设置文字滚动 </title> <style type="text/css"> body{ margin:0; border:0; padding:0;} #div{ width:400px; height:300px; background-image:url();} </style> </head> <body> <div id="div" ><marquee behavior="alternate">marquee标签设置文字滚动 </marquee> </div> </body> </html>~