Tip: you can modify some code before running
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>Js slide effect</title></head><body><div ><div id="aa" ></div></div><div ><div id="bb" ></div></div><div id="x"></div><script>var $ = function (id) {return "string" == typeof id ? document.getElementById(id) : id;};var ss = 0;var s = 250;var tt = 50;var a = 2*s/(tt*tt);var o = $("aa");var i = 0;var t = 0;function run(){t++;i = parseInt(.5 * a * (t*t));if(i>=s){ o.style.left = ss + s + "px";i = 0;t=0;ss=s;run2(); return; }o.style.left = ss + i + "px";setTimeout(run, 1);}function run2(){t++;i = parseInt((a*tt)*t - .5 * a * (t*t));if(i>=s){ o.style.left = ss + s + "px"; return; }o.style.left = ss + i + "px";setTimeout(run2, 1);}run();var s3=500;var n3=0;var b=0;var o3 = $("bb");function run3(){b+=5;if(b>s3){ o3.style.left = s3 + "px"; return; }o3.style.left = b + "px";setTimeout(run3, 10);}run3();</script>Www.111cn.net</body></html>
Tip: you can modify some code before running