window.onload=function(){
var Oli=document.getElementsByTagName("li");
for (var i = 0; i < Oli.length; i++) {
Oli[i].timer=null;
Oli[i].onmouseover=function(){
startMove(this,400);
}
Oli[i].onmouseout=function(){
startMove(this,200);
}
}
}
var Oli=document.getElementsByTagName("li");
for (var i = 0; i < Oli.length; i++) {
Oli[i].timer=null;
Oli[i].onmouseover=function(){
startMove(this,400);
}
Oli[i].onmouseout=function(){
startMove(this,200);
}
}
}
2017-11-13
<style type="text/css">
*{ margin: 0; padding: 0; list-style: none; }
ul li{ background: #7abcf2; width: 200px; height: 80px; margin: 15px; }
</style>
<ul>
<li></li>
<li></li>
<li></li>
</ul>
*{ margin: 0; padding: 0; list-style: none; }
ul li{ background: #7abcf2; width: 200px; height: 80px; margin: 15px; }
</style>
<ul>
<li></li>
<li></li>
<li></li>
</ul>
2017-11-13
timer = setInterval(function(){
var speed=(target-odiv.offsetLeft)/20;
if(odiv.offsetLeft>=target){
clearInterval(timer);
}else{
odiv.style.left =odiv.offsetLeft + speed+"px"; //变大
}
},500)
var speed=(target-odiv.offsetLeft)/20;
if(odiv.offsetLeft>=target){
clearInterval(timer);
}else{
odiv.style.left =odiv.offsetLeft + speed+"px"; //变大
}
},500)
2017-11-01
function move(target){
clearInterval(timer);
odiv=document.getElementById("div1");
}
clearInterval(timer);
odiv=document.getElementById("div1");
}
2017-11-01
我的move可以移除怎么out缩不进去啊 window.onload=function(){
odiv=document.getElementById("div1");
odiv.onmouseover=function(){
move(0);
}
odiv.onmouseout=function(){
move(-200);
}
}
var timer=null;
odiv=document.getElementById("div1");
odiv.onmouseover=function(){
move(0);
}
odiv.onmouseout=function(){
move(-200);
}
}
var timer=null;
2017-11-01
vtimer=etinterval(function(target){var speed=0; if(div.offsetleft>target){seed=-10;}else{speed=10;}},30)
2017-10-31
window.onload=function(){ var odiv=document.getelemtnbyid("div); odiv.onmouseover=function(){startMOve();}}odiv.stylevar timer=null; function startmove(){ cleatinterval(timer);timer=setinterval(function(){odiv.style.lft=odiv.offsetLeft+10+"px; if(div.offsetleft>=0{clearinterval (timer);}}),30}
2017-10-31