<script type="text/javascript">
var rotation = 0;
jQuery.fn.rotate = function(degrees) {
$(this).css({'-webkit-transform' : 'rotate('+ degrees +'deg)',
'-moz-transform' : 'rotate('+ degrees +'deg)',
'-ms-transform' : 'rotate('+ degrees +'deg)',
'transform' : 'rotate('+ degrees +'deg)'});
};
$('.rotate').click(function() {
rotation += 90;
$(this).rotate(rotation);
});
</script>
<a href="image/<?php echo $data['dir']; ?>" download="image/<?php echo $data['dir']; ?>">Download This Image</a>
I want to rotate an image with jQuery, then I want to be able to save the resulting image which is the rotated version of the origianl. I followed the instructions at: How to rotate a div using jQuery without much success. What can I do to fix this problem ?