PHP JS怎么实现让多个div自动交换位子,就好像滚动似的
不是,我是实现两个div里面的图片,多张图片,最外层用div包住,实现自动滚动,
<div id=demo style=overflow:hidden;height:139;width:232;background:#f4f4f4;color:#ffffff>
<div id=demo1>
<img src="http://www.lanrentuku.com/down/js/images/12460764740.jpg">
<img src="http://www.lanrentuku.com/down/js/images/12460764741.jpg">
<img src="http://www.lanrentuku.com/down/js/images/12460764742.jpg">
<img src="http://www.lanrentuku.com/down/js/images/12460764743.jpg">
<img src="http://www.lanrentuku.com/down/js/images/12460764744.jpg">
</div>
<div id=demo2></div>
</div>
<script>
var speed=50
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetTop-demo.scrollTop<=0)
demo.scrollTop-=demo1.offsetHeight
else{
demo.scrollTop++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
<p>
参考下这个
2015-11-14
一般有这样的现成的插件