Difference between revisions of "Template:Freiburg/Menubar"
Line 16: | Line 16: | ||
#header { | #header { | ||
− | + | position: fixed; | |
+ | width: 100%; | ||
+ | margin-top: 0px; | ||
z-index: 600; | z-index: 600; | ||
} | } | ||
Line 489: | Line 491: | ||
</script> | </script> | ||
+ | |||
+ | <script> | ||
+ | /*Attachable menu code*/ | ||
+ | $( document ).ready(function() { | ||
+ | |||
+ | $(window).scroll(function (event) { | ||
+ | var y = $(this).scrollTop(); | ||
+ | if(y>60){ | ||
+ | |||
+ | $("#header").css('position','fixed'); | ||
+ | $("#header").css('width','100%'); | ||
+ | $("#header").css('margin-top','-61px'); | ||
+ | $("#bottom-arrow").css('display','none'); | ||
+ | $("#runningchip-back").css('display','none'); | ||
+ | $("#navtext").css('margin-top','-20px'); | ||
+ | }else{ | ||
+ | var offsetTop = -y; | ||
+ | $("#header").css('margin-top',offsetTop+'px'); | ||
+ | $("#bottom-arrow").removeAttr('style'); | ||
+ | $("#runningchip-back").removeAttr('style'); | ||
+ | $("#navtext").removeAttr('style'); | ||
+ | } | ||
+ | |||
+ | }); | ||
+ | |||
+ | |||
+ | }); | ||
+ | |||
+ | </script> | ||
<!------------- END: jQuery -------------> | <!------------- END: jQuery -------------> |
Revision as of 18:31, 10 September 2015