In the example below, when you click the div, it will rotate and skew, but it looks like the position moves a few pixels to the right during this transition.
Is there a way to force it to stay put on the left side during the transition? I have played with origin, but haven't been able to get it just right:
$('div.book').click(function() {
$(this).toggleClass('open');
});
div.bg {
background-color: #00adef;
display: inline-block
}
.book {
transition: all 2s;
width: 145px;
height: 200px;
background-color: #333;
-webkit-origin: left;
}
.book.open {
-webkit-transform: rotateY(-90deg) skewY(-45deg);
-webkit-transform-origin: 0 0;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class='bg'>
<div class='book'>
</div>
</div>