Home › Forums › JavaScript › How can I set the width at which this menu collapses? › Reply To: How can I set the width at which this menu collapses?
September 23, 2013 at 7:10 pm
#151062
Alen
Participant
Did you read the comments in the code?
/* width of menu list (non-toggled) */
var $width = 0;
$(this).find('ul li').each(function(){
$width += $(this).outerWidth();
});
// if modern browser
if ($.support.leadingWhitespace){
$(this).css('max-width' , $width*1.05+'px');
}
else { $(this).css('width' , $width*1.05+'px'); }
Also, look at the adaptMenu()
function.