Difference between revisions of "Template:Pitt"
Line 125: | Line 125: | ||
}); | }); | ||
})(jQuery); | })(jQuery); | ||
+ | |||
+ | $("#menuContainer > ul > li:has(ul)").children("ul").each(function(){ | ||
+ | var padding = parseInt($(this).parent().css("padding-left")) + parseInt($(this).parent().css("padding-right")); | ||
+ | var newWidth = parseInt($(this).parent().css("width")) + padding; | ||
+ | if (newWidth > parseInt($(this).css("width"))){ | ||
+ | $(this).css("width", newWidth + 'px'); | ||
+ | } else { | ||
+ | $(this).parent().css("width", (parseInt($(this).css("width")) - padding) +'px'); | ||
+ | } | ||
+ | }); | ||
+ | |||
+ | var size = 0; | ||
+ | var number = 0; | ||
+ | $("#menuContainer > ul > li").each(function(){ | ||
+ | size += $(this).width(); | ||
+ | number++; | ||
+ | }); | ||
+ | var padding = ($(document).width() - size)/(2*number) - 1; | ||
+ | $("#menuContainer > ul > li").css({"padding-left": padding + 'px', "padding-right": padding + 'px'}); | ||
$("#menuContainer li").hover( | $("#menuContainer li").hover( | ||
Line 267: | Line 286: | ||
color: #ffffff; | color: #ffffff; | ||
margin: 0px; | margin: 0px; | ||
− | |||
white-space: nowrap; | white-space: nowrap; | ||
} | } |
Revision as of 02:57, 22 May 2015