Java script Header fixed on scroll or, add remove class with jquery based on vertical-scroll

Hello Guys

Please refer this js code for your solution

===========================================================
<script type="text/javascript">
  // Css Zilla Fixed navigation
   jQuery(window).scroll(function() {   
    var scroll = jQuery(window).scrollTop();

     //>=, not <=
    if (scroll >= 500) {
        //clearHeader, not clearheader - caps H
        jQuery("#home").addClass("nav_top");
  //alert("Css zilla welcomes you");
    }
});
</script>

===========================================================


Css Zilla Team

Comments

Popular Posts