Difference between revisions of "Template:Pitt"
Line 31: | Line 31: | ||
if (newWidth > parseInt($(this).css("width"))){ | if (newWidth > parseInt($(this).css("width"))){ | ||
$(this).css("width", newWidth + 'px'); | $(this).css("width", newWidth + 'px'); | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | $(window).scroll(function(){ | ||
+ | var menuOffset = $("#menuContainer").offset().top; | ||
+ | if($(window).scrollTop() > menuOffset){ | ||
+ | $("menuContainer").removeClass("floatyMenu").addClass("staticMenu"); | ||
+ | } | ||
+ | if($(window).scrollTop() < menuOffset){ | ||
+ | $("menuContainer").removeClass("staticMenu").addClass("floatyMenu"); | ||
} | } | ||
}); | }); | ||
Line 142: | Line 152: | ||
padding: 15px; | padding: 15px; | ||
padding-top: 5px; | padding-top: 5px; | ||
+ | } | ||
+ | |||
+ | .floatyMenu { | ||
+ | position: static; | ||
+ | } | ||
+ | |||
+ | .staticMenu { | ||
+ | position: fixed; | ||
+ | left: 0; | ||
+ | top: 0; | ||
} | } | ||
Line 154: | Line 174: | ||
</div> | </div> | ||
− | <div id="menuContainer"> | + | <div id="menuContainer" class="floatyMenu"> |
<ul> | <ul> | ||
<li> | <li> |
Revision as of 00:54, 22 May 2015