Skip to content

Instantly share code, notes, and snippets.

@thomasjbradley
Last active October 29, 2018 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasjbradley/99327f3da761caaa8a20a6919a47f262 to your computer and use it in GitHub Desktop.
Save thomasjbradley/99327f3da761caaa8a20a6919a47f262 to your computer and use it in GitHub Desktop.
A replacement for jQuery in the JavaScript & jQuery effects video playlist. https://www.youtube.com/playlist?list=PLWjCJDeWfDdfAAbxA-H5XHQlGoLICyHe_
var sun = document.querySelector('.sun');
window.addEventListener('scroll', function () {
var top = window.scrollTop / 3;
sun.style.transform = 'rotate(' + top + 'deg)';
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment