I am rotating a coin along Y axis by 90deg through CSS. Is there a way so that I can show the thickness of the coin after it have rotated, I thought I can scaleY after the coin have rotated along Y axis but this doesn’t seem to work. Please suggest some way to do the same if it is possible. link_on_js fiddle for the same. Please use webkit browsers to open the link.
css
.coin {
display: block;
background: url("url-to-image-of-coin.jpg");
background-size: 100% 100%;
width: 100px;
height: 100px;
margin: auto;
border-radius: 100%;
transition: all 500ms linear;
}
.flip {
transform: rotateY(180deg);
}
html
<div class="coin"></div>
jquery
$('.coin').click(function() {
$(this).toggleClass('flip');
});
fiddle
You can use pseudo-elements to give an effect that is similar. Here is an example: http://jsfiddle.net/joshnh/y7rQL/
Also, here is a version that spins 180 degrees (it isn’t quite as nice though): http://jsfiddle.net/joshnh/Bz22S/