I'm faced with a challenge where I have an element that needs to be rotated using JavaScript. The rotation is currently functional, but it's rotating around points other than its center.
My goal is to rotate the element around its own center. Any tips on how I can achieve this?
$(window).on('scroll', function() {
var scrollTop = $(window).scrollTop();
$('.section-4 .photo .after').css('transform', 'rotate('+ (scrollTop / 10) +'deg)');
});