$('.front').click(function(){ $(this).toggleClass('rotation-animation'); });
<img class="front rotation-animation" src="http://lorempixel.com/100/100/people/" >
img.front { transform:perspective(1000px) rotateY(0deg); margin:0; display:block; width:320px; height:320px; margin:100px auto } .rotation-animation { animation:my-rotation 2s infinite; } @keyframes my-rotation { 50% { transform:perspective(1000px) rotateY(180deg); } 100% { transform:perspective(1000px) rotateY(360deg); } }