I've been searching for a way to rotate an image a div say 90 degrees when a link is clicked, but can not seem to get it to at all. Here is some code I'm trying at the moment amongst many others, using the
jQuery Rotate plugin.
- $('#canvas a').click(function() {
- $('#circle').rotateLeft([angle=90]);
- return false;
- });
Edit: I can get it to kind of work with css3, although it doesn't animate, and it only rotates once. I would like to keep rotating each time a link is clicked.
- $(document).ready(function(){
- $('#canvas a').click(function(){
- $('#circle img').css({"-webkit-transform" : "rotate(+45deg)"})
- });
- });