Script to calculate width, and either resize, show, or hide HTML menu
Suggestion: The Math.max method is shorter than ternary operator:

maxWidth = Math.max(maxWidth, $(this).width());
maxWidth = maxWidth &gt; $(this).width() ? maxWidth : $(this).width();