为什么我的setinterval(move,2000)里面的这个Move 不能用“Move()”代替啊 如果代替了 就显示move未定义
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html" charset="gb2312" />
<title>团购——限时抢</title>
<style type="text/css">
*{margin:0px;padding:0px;}
#contain{width:300px;position:absolute;left:300px;top:300px;border:1px solid #999999;}
#text{overflow:hidden;height:144px;}
#con1{width:300px;}
li{height:24px;}
</style>
<script>
window.onload = function (){
var otex= document.getElementById('text');
var ocon1= document.getElementById('con1');
var ocon2= document.getElementById('con2');
otex.scrollTop = 0;
var timer;
var time1;
function Move(){
otex.scrollTop++;
if(otex.scrollTop%24 ==0){
clearInterval(timer);
time1=setTimeout(startMove,2000);
}
ocon2.innerHTML = ocon1.innerHTML;
if(otex.scrollTop>=ocon1.offsetHeight){
otex.scrollTop = 0;
}
}
function startMove(){
timer = setInterval(Move,50);
}
startMove();
otex.onmouseover =function(){
clearInterval(timer);
clearTimeout(time1);
}
otex.onmouseout =function(){
timer = setInterval(Move,50);
}
}
</script>
</head>
<body>
<div id="contain">
<h1>下面是滚动</h1>
<div id="text">
<ul id="con1">
<li>知章骑马似乘船,眼花落井水底眠。</li>
<li>汝阳三斗始朝天,道逢麴车口流涎,</li>
<li>恨不移封向酒泉。左相日兴费万钱,</li>
<li>饮如长鲸吸百川,衔杯乐圣称避贤。</li>
<li>宗之潇洒美少年,举觞白眼望青天,</li>
<li>皎如玉树临风前。苏晋长斋绣佛前,</li>
<li>醉中往往爱逃禅。李白斗酒诗百篇,</li>
<li>长安市上酒家眠,天子呼来不上船,</li>
<li>自称臣是酒中仙。张旭三杯草圣传,</li>
<li>脱帽露顶王公前,挥毫落纸如云烟。</li>
<li>焦遂五斗方卓然,高谈雄辩惊四筵。</li>
</ul>
<ul id="con2">
</ul>
</div>
</div>
</body>
</html>
Lzzzzzzzz_M
Lzzzzzzzz_M
相关分类