Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- $(window).on("scroll", function() {
- if (window.location.href.includes("index") == true)
- if ($(window).scrollTop() > 500) {
- $(".navbar-section").addClass("active");
- } else {
- //remove the background property so it comes transparent again (defined in my css)
- $(".navbar-section").removeClass("active");
- }
- if (window.location.href.includes("index") == false)
- if ($(window).scrollTop() > 50) {
- $(".navbar-section").addClass("active");
- } else {
- //remove the background property so it comes transparent again (defined in my css)
- $(".navbar-section").removeClass("active");
- }
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement