Rotate image with CSS animation using JQuery animate() method

AuthorHariom Prajapati

Pubish Date24 Jun 2022


In this tutorial we will learn how to rotate image with CSS animation using jQuery animate() method.

Using this you can rotate image according to your need like 90 degrees, 180 degrees or 360 degrees using CSS animation using jQuery function.

there are many type plugin available using which we can rotate image but i will suggest you to use CSS animation or jQuery animation method because if you use this then you can easily customize it.


Here we will use jQuery animate() method to rotate image with CSS animation using jQuery.


    <title>Rotate image with CSS animation using JQuery</title>
    <script src=""></script>

    <img src=""
    <button>Rotate image</button>
    <script type="text/javascript">
        var tmpAnimation = 0;
        $("button").click(function () {
            var element = $("img");
            tmpAnimation = tmpAnimation + 90;
                degrees: tmpAnimation - 90
                degrees: tmpAnimation
            }, {
                duration: 2000,
                step: function (now) {
                        transform: 'rotate(' + now + 'deg)'





Comments 0

Leave a comment