sizing - jQuery Set height of 2 independent lists first list li the same height as second li -


i have html code:

<div class="inner">     <div class="label fivecol">         <ul class="extraquestionname">             <li>amount of bedrooms</li>             <li>year built:</li>             <li>amount of bathrooms</li>             <li>city:</li>             <li>amount of stables</li>             <li>amount of paddocks</li>             <li>approximate acres:</li>         </ul>     </div>     <div class="data sevencol last">         <ul class="extraquestionvalue">             <li>2-4</li>             <li>2005</li>             <li>0-2</li>             <li>norwich</li>             <li>0 - 2</li>             <li>5 - 7</li>             <li>5</li>         </ul>     </div> </div> 

i require second lists li element same height matched li first list if makes sense.

these elements dynamic , amounts of list items change come in matched pairs.

does have idea how accomplish in jquery have no idea.

cheers.

http://jsfiddle.net/evspt/

$(document).ready(function() {     $('.extraquestionname li').each(function(i) {         $('.extraquestionvalue li').eq(i).height($(this).height());     }); }); 

the each() function has index parameter. loops through li elements in first list, , uses eq() find item same index in second list, set height.


Comments