On this website http://www.contrastrebellion.com/ about half way through there is a circle that rotates depending on how far down or up you scroll the page. How can this be achieved without having to rely on Facebook like this site does?
On this website http://www.contrastrebellion.com/ about half way through there is a circle that rotates
Share
The feature was implemented in http://www.contrastrebellion.com/public/js/script.js?2
Look at the code block starting with
It uses jQuery
.scrolland CSS transformations (including the browser-specific versions of it) for the effect.Side note: it fails to do any of the JS magic in my main browser, because I’m blocking Facebook domains. Moral of the story: don’t make your entire JS depend on one small subset of your sites featureset.