Search Results

Search found 2 results on 1 pages for 'epco'.

Page 1/1 | 1 

  • add width li's to parent ul

    - by Epco
    i would like to calculate the width of the li's for each submenu en then put in the ul element. example <ul> <li>level 1</li> <li> <ul style="widht:??;"> // total width li's added here 70px <li>level 2</li> // width of this li 20px <li>level 2</li>/ width of this li 50px </ul> </li> <li>level 1</li> <li>level 1 <ul style="widht:??;"> // total width li's added here 70px <li>level 2</li> // width of this li 20px <li>level 2</li>/ width of this li 50px </ul> </li> </ul> i have this so fare if ('#menu li:has(ul) ul'){ $('li').each(function(){ widthParentUl += $(this).outerWidth(true) }); $(this)parent.('ul').attr('style','width:' + widthParentUl +'px; display:block; background:red;'); }

    Read the article

  • jquery outerwidth submenu items

    - by Epco
    i'm looking for a way to calculate the total width of de level 2 items and put it in the ul. I have looked at some jquery thinks like outerWidth and .lengt but can't figure it out. thanks in advance $('#menu li:has(ul) ul').each(function() <ul> <li>level 1</li> <li> <ul style="widht:??;"> <li>level 2</li> <li>level 2</li> </ul> </li> <li>level 1</li> </ul>

    Read the article

1