原生js:
window.onload=function(){ var oBox=document.getElementById("box"); var oTo=document.getElementById("to"); oBox.onmouseover=function(){ move(oBox,{right:0},{time:500,easing:'ease-out'}); } oBox.onmouseout=function(){ move(oBox,{right:-150},{time:500,easing:'ease-out'}); } }
jquery:
$(function(){ $('#box').hover(function(){ move($(this)[0],{right:0},{time:500,easing:'ease-out'}); },function(){ move($(this)[0],{right:-150},{time:500,easing:'ease-out'}); }); });