javascript - How can I rotate two divs to form an X when I click the container div? -
here's have now: code
this html
<div id="box"> <div id="line1" class="line"></div> <div id="line2" class="line"></div> <div id="line3" class="line"></div> </div>
i use jquery rotate line1 , line3 form x , make line2 disappear when click container div (#box). idea of jquery because of animation, other ideas welcome.
you can this
.rotatel{ transform:rotate(45deg) translatex(10px); -webkit-transform:rotate(45deg) translatex(10px); transform-origin:30%; -webkit-transform-origin:30%; } .rotater{ transform:rotate(-45deg) translatey(10px); -webkit-transform:rotate(-45deg) translatey(10px); transform-origin:22%; -webkit-transform-origin:22%; }
Comments
Post a Comment