Difference between revisions of "Template:Manchester/CSS1"

Line 700: Line 700:
  
  
 +
</script>
 +
 +
<script>
 +
function checkScroll(){
 +
    var startY = $('nav > ul').height() * 2; //The point where the navbar changes in px
 +
 +
    if($(window).scrollTop() > startY){
 +
        $('nav > ul').addClass("scrolled");
 +
    }else{
 +
        $('nav > ul').removeClass("scrolled");
 +
    }
 +
}
 +
 +
if($('nav > ul').length > 0){
 +
    $(window).on("scroll load resize", function(){
 +
        checkScroll();
 +
    });
 +
}
 
</script>
 
</script>
  
 
</html>
 
</html>

Revision as of 10:48, 16 September 2016