Created
September 5, 2020 07:03
-
-
Save wpflames/a0a094f47a6c52e7f56d88c3357b681a to your computer and use it in GitHub Desktop.
Responsive Website with HTML / CSS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.addEventListener("scroll", function(){ | |
| var header = document.querySelector("header"); | |
| header.classList.toggle("sticky", window.scrollY > 0); | |
| }) | |
| function toggle(){ | |
| var header = document.querySelector('header'); | |
| header.classList.toggle('active'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment