I'm trying to add a numbered dial image to my website that rotates in small increments when it is clicked. The javascript from here is exactly what I'm looking for: CSS3 transition on click using pure CSS
But using that code, it only rotates once, then when clicked again, it moves back to its original position. I've fiddled around with the code to the best of my abilities (which consists of me trying random things until something works) and I've managed to make it rotate 36 degrees on the first and second click, but I'm not sure how to make it continue rotating after that. I would like it to be able to rotate 36 degrees on each click so that after clicking 10 times, it brings it back to its original position.
I'm sure the solution is very simple, but I can't seem to figure it out. Any help would be appreciated.
Here's the javascript:
$( ".crossRotate" ).click(function() {
//alert($( this ).css( "transform" ));
if ( $( this ).css( "transform" ) == 'none' ){
$(this).css("transform","rotate(36deg)");
} else {
$(this).css("transform","rotate(72deg)" );
}
});
And the jsfiddle demo: http://jsfiddle.net/rv5PR/472/