Difference between revisions of "Team:NTNU Trondheim/Header"

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

Revision as of 11:58, 6 August 2018