js图片跑马灯效果
<style. type="text/css">
body{margin:0px auto; padding:0px;}
ul,li{margin:0px; padding:0px;list-style.:none;}
.sqBorder {width:122px; height:182px; padding:10px; border:1px #000000 solid; background:#555555;}
.scroll_div {width:122px; height:180px; margin:0 auto; overflow: hidden; white-space: nowrap; background:#ffffff;}
.scroll_div img {width:120px;height:60px;border:0;margin: 8px auto; border:1px #efefef solid;}
</style>
<script. language="javascript">
function ScrollImgTop(){
var speed=20; //品络科技 www.pinluo.com
var scroll_begin = document.getElementById("scroll_begin");
var scroll_end = document.getElementById("scroll_end");
var scroll_div = document.getElementById("scroll_div");
scroll_end.innerHTML=scroll_begin.innerHTML
function Marquee(){
if(scroll_end.offsetTop-scroll_div.scrollTop<=0)
scroll_div.scrollTop-=scroll_begin.offsetHeight
else
scroll_div.scrollTop++
}
var MyMar=setInterval(Marquee,speed)
scroll_div.onmouseover=function() {clearInterval(MyMar)}
scroll_div.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
}
</script>
<h2 align="center">向上滚动</h2>
<div style="text-align:center">
<div class="sqBorder">
<!--#####滚动区域#####-->
<div id="scroll_div" class="scroll_div">
<div id="scroll_begin">
<ul>
<li><img src=http://www.1netmedia.net/images/main_logo.gif /></li>
<li><img src="http://www.1netmedia.net/images/main_logo.gif" /></li>
<li><img src=http://www.1netmedia.net/images/main_logo.gif" /></li>
<li><img src="http://www.1netmedia.net/images/main_logo.gif" /></li>
<li><img src="http://www.1netmedia.net/images/main_logo.gif"/></li>
<li><img src="http://www.1netmedia.net/images/main_logo.gif" /></li>
</ul>
</div>
<div id="scroll_end"></div>
</div>
<!--#####滚动区域#####-->
</div>
<script. type="text/javascript">ScrollImgTop();</script>
</div>
<!--//向上滚动代码结束-->