Rotate logo on scroll

Marko Krstić
29 Dec 2020

If you need to rotate logo while you are scrolling the page like on Matthias Altmann’s website here is the code he shared with us

(function($) {
		$(window).scroll(function() {
		var deg = $(window).scrollTop()/2;
		$('#header-company-logo').css({ transform: 'rotate(' + deg + 'deg)' });


Was this article helpful?



Never miss new post again

Subscribe and get list of new posts in your inbox

Click to Copy