crop_rotate
Run
<!DOCTYPE html> <html> <style> #container { width: 400px; height: 100px; position: relative; background: yellow; } #animate { width: 50px; height: 50px; position: absolute; background-color: red; border-radius:50%; margin-top:20px; } </style> <body> <p><button onclick="myMove()">Click Me</button></p> <div id ="container"> <div id ="animate"></div> </div> <script> var id = null; function myMove() { var elem = document.getElementById("animate"); var pos = 0; clearInterval(id); id = setInterval(frame, 5); function frame() { if (pos == 350) { clearInterval(id); } else { pos++; elem.style.left = pos + "px"; } } } </script> </body> </html>
PCFET0NUWVBFIGh0bWw+DQo8aHRtbD4NCjxzdHlsZT4NCiNjb250YWluZXIgew0KICB3aWR0aDogNDAwcHg7DQogIGhlaWdodDogMTAwcHg7DQogIHBvc2l0aW9uOiByZWxhdGl2ZTsNCiAgYmFja2dyb3VuZDogeWVsbG93Ow0KfQ0KI2FuaW1hdGUgew0KICB3aWR0aDogNTBweDsNCiAgaGVpZ2h0OiA1MHB4Ow0KICBwb3NpdGlvbjogYWJzb2x1dGU7DQogIGJhY2tncm91bmQtY29sb3I6IHJlZDsNCiAgYm9yZGVyLXJhZGl1czo1MCU7DQogIG1hcmdpbi10b3A6MjBweDsNCn0NCjwvc3R5bGU+DQo8Ym9keT4NCg0KPHA+PGJ1dHRvbiBvbmNsaWNrPSJteU1vdmUoKSI+Q2xpY2sgTWU8L2J1dHRvbj48L3A+IA0KDQo8ZGl2IGlkID0iY29udGFpbmVyIj4NCiAgPGRpdiBpZCA9ImFuaW1hdGUiPjwvZGl2Pg0KPC9kaXY+DQoNCjxzY3JpcHQ+DQp2YXIgaWQgPSBudWxsOw0KZnVuY3Rpb24gbXlNb3ZlKCkgew0KICB2YXIgZWxlbSA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJhbmltYXRlIik7ICAgDQogIHZhciBwb3MgPSAwOw0KICBjbGVhckludGVydmFsKGlkKTsNCiAgaWQgPSBzZXRJbnRlcnZhbChmcmFtZSwgNSk7DQogIGZ1bmN0aW9uIGZyYW1lKCkgew0KICAgIGlmIChwb3MgPT0gMzUwKSB7DQogICAgICBjbGVhckludGVydmFsKGlkKTsNCiAgICB9IGVsc2Ugew0KICAgICAgcG9zKys7IA0KICAgICAgZWxlbS5zdHlsZS5sZWZ0ID0gcG9zICsgInB4IjsgDQogICAgfQ0KICB9DQp9DQo8L3NjcmlwdD4NCg0KPC9ib2R5Pg0KPC9odG1sPg==