Navigation bar collapse on scroll

    0

    0

    let navbarCollapse = function () {
      if (jQuery("#mainNav").offset().top > 100) {
        jQuery("#mainNav").addClass("navbar-scrolled")
        jQuery("#mainNav").css("padding", "1rem 0")
      } else {
        jQuery("#mainNav").removeClass("navbar-scrolled")
        jQuery("#mainNav").css("padding", "3rem 0")
      }
    }
    navbarCollapse()
    
    jQuery(window).scroll(navbarCollapse)
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.