<div id="demo" style="overflow:hiddenheight:500pxwidth:120pxborder:1px solid #dde5bcoverflow:hiddenfloat:left">
<div id=demo1>
<img src="images/js01.gif" width="120" height="120">
<img src="images/js02.gif" width="120" height="120">
<img src="images/js03.gif" width="120" height="120">
<img src="images/js04.gif" width="120" height="120">
<img src="images/js05.gif" width="120" height="120">
<img src="images/js06.gif" width="120" height="120">
<img src="images/js07.gif" width="120" height="120">
<img src="images/js08.gif" width="120" height="120">
<img src="images/js09.gif" width="120" height="120">
</div>
<div id=demo2></div>
</div>
<script>
var speed=40
var demo=document.getElementById("demo")
var demo2=document.getElementById("demo2")
var demo1=document.getElementById("demo1")
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 type="text/javascript">$(document).ready(function() {
var Top = -400 //定义一个向上移动的距离,这个数值和你图片或DIV的高度相等
var Time = 500 //定义一个速度
function move() {
if ($("#box").is(":animated")) return
$("#box").animate({
"margin-top": Top
}, Time) //animate方法,只能对数值型的值进行渐变
Top += -400 //运行一次增加一个图片的高度
if (Top == -800) //判断当总高度大于你DIV或者图片总高度
{
Top = 0 //把距离设置回0
Time = 500 //加快移动速度
} else {
Time = 500 //否则减慢速度
}
}
setInterval(move, 6000) //3秒执行一次move()
})
</script>
function showImg(index){var adWidth = $(".content_right .ad").width()
$(".slider").stop(true,false).animate({left : -adWidth*index},1000)
$(".num li").removeClass("on")
.eq(index).addClass("on")
}
当然你也要调整样式的