Javascript examples for jQuery:Image
Rotate an image with css/javascript
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> </head> <body> <img id="rotater" onclick="rotate();" src="anyImage.png"> <script type="text/javascript"> let rotateAngle = 180;/* w ww . j a v a 2 s . c om*/ function rotate(){ $("#rotater").css({'transform': 'rotate('+rotateAngle+'deg)'}); rotateAngle = rotateAngle + 180; } </script> </body> </html>