Skip to content

Instantly share code, notes, and snippets.

@ArmandoPrieto
Created September 6, 2018 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArmandoPrieto/e3018417c31c36308802158ff185c831 to your computer and use it in GitHub Desktop.
Save ArmandoPrieto/e3018417c31c36308802158ff185c831 to your computer and use it in GitHub Desktop.
CSS Transition
<html>
<body>
<div class="box">
<div class="innerbox">
</div>
</div>
</body>
</html>
/*$(".box").hover(function() {
$('.innerbox').addClass("movement");
});
*/
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
.box
width: 150px
height: 150px
border: 20px solid #999
background: #ddd
.innerbox
display: inline-block
background: pink
width: 150px
height: 150px
transition: transform 300ms ease-in-out
pointer-events: none
.box:hover .innerbox
transform: translate(200px,150px) rotate(20deg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment