TAG
CSS
JavaScript
Result
Run
License
<div id="box">Click me</div>
#box { width: 100px; height: 100px; background: #0000FF; display: inline-block; position: absolute; top: 10%; color: #FFF; text-align: center; line-height: 100px; }
window.addEventListener("load", function() { var el = document.querySelector("#box"); el.onclick = function() { this.animate([ { left: "0%", transform: "rotate(0deg)" }, { left: "50%", transform: "rotate(360deg)" } ], { duration: 2000, fill: "forwards" }); }; });
Console
expand_less
License
License
by DevDic
Close