Hello,
I’m trying to make my logo (top left in header) rotate when the page is scrolled.
Everything works fine in the Pro editor preview, but nothing happens on the front end (final) page.
Can you help me out?
https://staging.muziekfabriek.com/home
–
I used this JS:
jQuery(function() {
var rotation = 100,
scrollLoc = $(document).scrollTop();
$(window).scroll(function() {
var newLoc = $(document).scrollTop();
var diff = scrollLoc - newLoc;
rotation += diff, scrollLoc = newLoc;
var rotationStr = “rotate(” + rotation + “deg)”;
$(".gear").css({
“-webkit-transform”: rotationStr,
“-moz-transform”: rotationStr,
“transform”: rotationStr
});
});
})