|
|
Line 489: |
Line 489: |
| }) | | }) |
| </script> | | </script> |
− | <script> | + | |
− | /*Attachable menu code*/
| + | |
− | $( document ).ready(function() {
| + | |
− | //overwrite css
| + | |
− | $("#header").css('position','fixed');
| + | |
− | $("#header").css('width','100%');
| + | |
− | $("#page-content").css('margin-top', '100px');
| + | |
− | $("#header").css('margin-top','-25px');
| + | |
− |
| + | |
− |
| + | |
− | | + | |
− | $(window).scroll(function (event) {
| + | |
− | var y = $(this).scrollTop();
| + | |
− | console.log(y);
| + | |
− | if(y>60){
| + | |
− | | + | |
− | $("#header").css('position','fixed');
| + | |
− | $("#header").css('width','100%');
| + | |
− | $("#header").css('margin-top','-83px');
| + | |
− | $("#bottom-arrow").css('display','none');
| + | |
− | $("#runningchip-back").css('display','none');
| + | |
− | $("#navtext").css('margin-top','-20px');
| + | |
− | }else{
| + | |
− | // $("#header").removeAttr('style');
| + | |
− |
| + | |
− | var offsetTop = -25-y;
| + | |
− | $("#header").css('margin-top',offsetTop+'px');
| + | |
− | $("#bottom-arrow").removeAttr('style');
| + | |
− | $("#runningchip-back").removeAttr('style');
| + | |
− | $("#navtext").removeAttr('style');
| + | |
− | }
| + | |
− | | + | |
− | });
| + | |
− | | + | |
− | | + | |
− | });
| + | |
− | | + | |
− | </script>
| + | |
| <!------------- END: jQuery -------------> | | <!------------- END: jQuery -------------> |
| | | |