Netferrets Online Blog, Internet Related Programming Solutions, Created in C# .net, VB .net, MS SQL Server Javascript, HTML and CSS. Proving sample solutions to problems found when creating web application solutions.
Sunday, 14 July 2013
Jquery, resize li tags automatically
Heres a bit of code I put together to stretch a menu to to the full width of the page regardless of how many items there are.
var orginalwidth = $(".nav").width;
var newwidth = 100 / $(".nav li").length;
$(".nav li").each(
function () {
$(this).css("width", newwidth + "%");
}
)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment