How to rotate (degree) an image using jQuery Slider?

I am wondering how to rotate an image when changing the value of the jQuery slider. For example, the degree of the image changes on the fly in accordance with the change of the slider to the left (0) to the right (360). I don't know how to pass the value of the slider to jQuery rotate () function. Please help me. Thanks to everyone in advance.

+3
source share
1 answer
$(document).ready(function() {
    $('.selector').slider({
        slide: function(event, ui) {
             $('.image').rotate(ui.value);
        }
    });
});

View the slide event .

+3
source

Source: https://habr.com/ru/post/1708879/


All Articles