|
|
Line 554: |
Line 554: |
| | | |
| | | |
− | <script>
| |
− | $(function() {
| |
− | $('#nav_bar li a').click(function() {
| |
− | $('#nav_bar li').removeClass();
| |
− | $($(this).attr('href')).addClass('active');
| |
− | });
| |
− | });
| |
− | </script>
| |
− |
| |
− | <script>
| |
− | function checkScroll(){
| |
− | var startY = window.innerHeight + 20; //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>
| |
| | | |
| | | |