Line 309: | Line 309: | ||
margin-top: -1rem; | margin-top: -1rem; | ||
} | } | ||
+ | |||
+ | if (window.pageYOffset < 250) { | ||
+ | $('#TopBar').css('position', 'static'); | ||
+ | $('#TopBar').css('margin-top', '-1rem'); | ||
+ | } | ||
+ | else { | ||
+ | $('#TopBar').css('position', 'fixed'); | ||
+ | $('#TopBar').css('margin-top', '1.5rem'); | ||
+ | } | ||
+ | |||
+ | $(window).scroll(function() { | ||
+ | if(window.pageYOffset < 250) { | ||
+ | $('#TopBar').css('position', 'static'); | ||
+ | $('#TopBar').css('margin-top', '-1rem'); | ||
+ | $('#MainContent').css('margin-top', '0'); | ||
+ | } | ||
+ | else { | ||
+ | $('#TopBar').css('position', 'fixed'); | ||
+ | $('#TopBar').css('margin-top', '1.5rem'); | ||
+ | $('#MainContent').css('margin-top', '12rem'); | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | |||
} | } |
Revision as of 18:15, 25 July 2017