Difference between revisions of "Template:British Columbia 2"

m
m
Line 126: Line 126:
 
   </nav>
 
   </nav>
 
</header>
 
</header>
<script>
 
// get the value of the bottom of the #main element by adding the offset of that element plus its height, set it as a variable
 
var mainbottom = $(".cover").offset().top + $(".cover").height();
 
  
// on scroll,
 
$(window).on("scroll",function(){
 
 
    // we round here to reduce a little workload
 
    stop = Math.round($(window).scrollTop());
 
    if (stop > mainbottom) {
 
        $('.navbar-default').addClass('.opaque-nav');
 
    } else {
 
        $('.navbar-default').removeClass('.opaque-nav');
 
  }
 
 
});
 
</script>
 
 
<body></body>
 
<body></body>
 
</html>
 
</html>

Revision as of 13:27, 3 October 2016

Home