大佬们,看看问题在哪,一点反应都没有
<!doctype html>
<html>
<head>
<style type="text/css">
#s{font-size: 13px;
color: white;
height: 30px;
width: 20px;
position: absolute;
top: 100px;
left: 0px;
background-color: aqua;
}
#ss{
height:230px;
width: 960px;
position: absolute;
top: 0px;
left: -960px;
background-color: brown;
}
</style>
<script type="text/javascript">
window.onload=function(){
var s1=document.getElementById("s");
s1.onmouseover=function(){
startmove();
}
}
var timer=null;
function startmove(){
var s2=document.getElementById("ss");
timer=setInterval(function(){
if(s2.offsetLeft==0){
clearInterval(timer);
}
else{
s2.style.left=s2.offsetLeft+10+'px';
}
},30);
}
</script>
<meta charset="utf-8">
<title>动态效果</title>
</head>
<body>
<div id="s">广<br>告</div>
<div id="ss"></div>
</body>
</html>