不间断滚动图片
<div><br><div id=demo style="overflow: hidden; width: 150px; height: 200px">
<div id=demo1><img src="http://www.toto369.net/txtx/17/1.jpg"><br><img src="http://www.toto369.net/txtx/17/2.jpg"><br><img src="http://www.toto369.net/txtx/17/3.jpg"><br><img src="http://www.toto369.net/txtx/17/4.jpg"><br><img src="http://www.toto369.net/txtx/17/5.jpg"><br></div>
<div id=demo2><img src="http://www.toto369.net/txtx/17/1.jpg"><br><img src="http://www.toto369.net/txtx/17/2.jpg"><br><img src="http://www.toto369.net/txtx/17/3.jpg"><br><img src="http://www.toto369.net/txtx/17/4.jpg"><br><img src="http://www.toto369.net/txtx/17/5.jpg"><br></div></div>
<script>
var speed=30;
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>
<script>
var speed=30;
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>
</div>加入如下代码到body区域<br><textarea class=yk9 name=source rows=12 cols=100><div id=demo style=overflow:hidden;height:200;width:150>
<div id=demo1>
<img src='17/1.jpg'><br>
<img src='17/2.jpg'><br>
<img src='17/3.jpg'><br>
<img src='17/4.jpg'><br>
<img src='17/5.jpg'><br>
</div>
<div id=demo2></div>
</div>
<script>
var speed=30;
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></textarea> <br><input onclick=source.select() type=button value=选取代码 name=b2>
<script language=javascript>
<!--
function closeclk() {
another=close();
}
//-->
</script>
<input onclick=closeclk() type=button value=关闭窗口 name=b22>
页:
[1]