Navbar Fixed JS Code Logic

Navbar Fixed JS Code Logic

<script>
    var navbar = document.querySelector('.fixed-top';

    window.onscroll = function() {
    // pageYOffset or scrollY
    if (window.pageYOffset > 0)
    {
        navbar.classList.add('scrolled')
    } 
    else
    {
        navbar.classList.remove('scrolled')
    }
    }
</script>

Post Your Comments & Reviews

Your email address will not be published. Required fields are marked *

*

*