I have successfully created a navigation menu that dynamically resizes each list item to fit the entire width of the menu using JavaScript.
$(function() {
changeWidth(500);
function changeWidth(menuWidth){
var menuItems = $('#menu li').size();
var itemWidth = (menuWidth/menuItems)-2;
$('#menu').css({'width': menuWidth +'px'});
$('#menu a').css({'width': itemWidth +'px'});
}
});
You can see it in action here.
I was wondering if there is a way to set the width to be 100% instead of declaring an absolute width like I currently have (500px)?
Thanks in advance!