How to Rotate Image using JQuery?

May 24, 2020 | Category : JQuery

This is a short guide on rotate image javascript animation. This article will give you simple example of jquery rotate image 360 animation. step by step explain rotate image 180 degrees jquery. you will learn rotate image jquery animate transform css. Let's see bellow example jquery rotate image on button click.

there are several plugin available for rotate image but i will suggest you using jquery animate and using CSS3 transform property. you need to just give value with deg as property. it will make simple and customize.

bellow example, when you click on button image will rotate each time 90 deg. you can simple copy html file and check it. it is a very simple example, just check bellow code.


<!DOCTYPE html>



<title>Jquery rotate image animation example -</title>

<script src=""></script>



<img src="">

<button>Rotate image</button>

<script type="text/javascript">

var tmpAnimation = 0;


var element = $("img");

tmpAnimation = tmpAnimation + 90;

$({degrees: tmpAnimation - 90}).animate({degrees: tmpAnimation}, {

duration: 2000,

step: function(now) {


transform: 'rotate(' + now + 'deg)'








I hope it can help you...