日期:2014-05-17  浏览次数:20799 次

图片首尾相接滚动
在html中用<marquee>...</marquee>标记能让图片滚动起来,但怎样才能让图片首尾相接的滚动呢?

------解决方案--------------------
http://www.wjdy666.com/index.shtml

这里有个,自己扣,懒得弄了
------解决方案--------------------
帮你把代码摘出来了

<div class="bottom_2" id="mypic"> 
<a href="/Article/honour/200905/20090514110622.shtml"><img class='pic1' src='/Article/UploadFiles/200905/2009051411064338.jpg' border='0'></a> 
<a href="/Article/honour/200905/20090514110524.shtml"><img class='pic1' src='/Article/UploadFiles/200905/2009051411060303.jpg' border='0'></a> 
<a href="/Article/honour/200905/20090514110413.shtml"><img class='pic1' src='/Article/UploadFiles/200905/2009051411044345.jpg' border='0'></a> 
<a href="/Article/honour/200905/20090514110310.shtml"><img class='pic1' src='/Article/UploadFiles/200905/2009051411034065.jpg' border='0'></a> 
<a href="/Article/honour/200905/20090514110227.shtml"><img class='pic1' src='/Article/UploadFiles/200905/2009051411025164.jpg' border='0'></a> 
<a href="/Article/honour/200905/20090514110155.shtml"><img class='pic1' src='/Article/UploadFiles/200905/2009051411021370.jpg' border='0'></a> 
<a href="/Article/honour/200905/20090514110015.shtml"><img class='pic1' src='/Article/UploadFiles/200905/2009051411004742.jpg' border='0'></a></div>
<script> 
var oMarquee = document.getElementById("mypic"); //滚动对象
var iLineHeight = 156; //单行高度,像素
var iLineCount = 7; //实际行数
var iScrollAmount = 1; //每次滚动高度,像素
function run() {
oMarquee.scrollLeft += iScrollAmount;
if ( oMarquee.scrollLeft == iLineCount * iLineHeight )
oMarquee.scrollLeft = 0;
if ( oMarquee.scrollLeft % iLineHeight == 0 ) {
window.setTimeout( "run()", 1 );
} else {
window.setTimeout( "run()", 1);
}
}
oMarquee.innerHTML += oMarquee.innerHTML;
window.setTimeout( "run()", 1 );
</script>
------解决方案--------------------
marquee 左右来回滚动可以无缝

<marquee direction="left" behavior="alternate" loop="-1" scrolldelay="100" scrollamount="3" onMouseOver="this.stop();" onMouseOut="this.start();">
...
</marquee>