类似效果要怎么做?谢谢!
现在想实现类似下面的效果,但是想让图片从右往左滚动,也要中间停留几秒钟,知道的朋友帮帮忙了.谢谢.
代码效果如下:
<script language="JavaScript" defer>
//code by windy_sk <windy_sk@126.com> 20040127
var obj_marquee = document.getElementById("marquee");
var marquee_spd = 4000;
var step_c = 0;
function marquee_init() {
var obj_unit = obj_marquee.firstChild;
var n = Math.ceil(parseInt(obj_marquee.style.height) / obj_unit.offsetHeight);
for(var i=0; i<n; i++) obj_marquee.appendChild(obj_unit.cloneNode(true));
return;
}
function marquee_show() {
var marquee_high = parseInt(obj_marquee.style.height);
var step = marquee_high/10;
if(obj_marquee.scrollTop >= obj_marquee.children[1].offsetTop) {
obj_marquee.scrollTop = 0;
marquee_show();
return;
}
obj_marquee.scrollTop += step;
if(step_c++ < 9) setTimeout("marquee_show()", 50);
return;
}
marquee_init();
setInterval("step_c=0;setTimeout('marquee_show()',50)", marquee_spd);
</script>
<table style="border:1px black solid;"><tr><td>
<div id="marquee" style="overflow:hidden;height:60px;width:210px;border:0px;padding:0px;">
<div style="border:0px;padding:0px">
<!-- Marquee Body Head -->
<div style="height:60px;width:210px;font-size:12px">
<a href="<A href="http://www.kdt.cn/kdt/introduce.php"><img">http://www.kdt.cn/kdt/introduce.php"><img src="http://www.blueidea.com/gg/kdt/206.gif" border="0" style="width:208px"></a>
这个是广告~~~~~~~~~
</div>
<div style="height:60px;width:210px;font-size:12px">
<a href="<A href="http://www.idc2008.com/index5.htm"><img">http://www.idc2008.com/index5.htm"><img src="http://www.blueidea.com/gg/idc2008/208X33.gif" border="0" style="width:208px"></a>
这个也是广告~~~~~~~~~~~~~~~~
</div>
<div style="height:60px;width:210px;font-size:12px">
<a href="<A href="http://www.qycity.com/"><img">http://www.qycity.com/"><img src="http://www.blueidea.com/gg/qycity/blueidea.gif" border="0" style="width:208px"></a>
这个怎么还是广告??????
</div>
<div style="height:60px;width:210px;font-size:12px">
<a href="<A href="http://www.blueidea.com/bbs/viewuser.asp?username=windy2000"><img">http://www.blueidea.com/bbs/viewuser.asp?username=windy2000"><img src="http://www.blueidea.com/bbs/icon/user1.gif" border="0"> Windy2000</a><br>
也给自己做个广告~~~~~~~~~~
</div>
<!-- Marquee Body Bottom -->
</div>
</div>
</td></tr></table>