modified js to set submenu width based on width top level ul

This commit is contained in:
tworrall 2011-06-08 20:55:53 +00:00
parent 09c2f33633
commit 91db1ad147

View file

@ -2,10 +2,13 @@
$(function(){ $(function(){
$("ul.dropdown li").hover(function(){ $("ul.dropdown li").hover(function(){
$(this).addClass("hover"); $(this).addClass("hover");
$('ul:first',this).css('visibility', 'visible'); $('ul:first',this).css('visibility', 'visible');
if ( $('ul.dropdown').width() > 88 ) {
$('ul:first li',this).css('width', ($("ul.dropdown").width() - 22) + 'px');
}
$("ul.dropdown ul.sub_menu li:last-child").css('width', ($("ul.dropdown").width() - 14) + 'px');
}, function(){ }, function(){