I came up with that (changed in your code):
It seems to be working but the 3rd level is broken

       var sfHovAr=$('li[ul]',this)
           .applyHovers(over,out)
           .find("a").each(function(){
               var $width = $(this).width();
               $(this).parent().width($width);
}) .find("a").each(function(){
               var $a = $(this), $li = $a.parents('li');
               $a.focus(function(){ $li.each(over); })
                 .blur(function(){ $li.each(out); });
           }).end();

I also removed all width definition in the css

Joel Birch wrote:

On 22/06/2007, at 12:45 AM, Olivier Percebois-Garve wrote:
I mean getting the width of each li's content and then to give that width to the li

On 6/21/07, Olivier Percebois-Garve < [EMAIL PROTECTED]> wrote:could such behavior be scripited ?

I'm sure it could be scripted. Depending on the CSS that is in effect before your script runs, you might wrap the contents of each li in a div element, get the width of the div, then apply that width to the parent li. You would still need to ensure that the menu still degrades gracefully without the script though.

Joel.


Reply via email to