javascript - Making dynamic sized boxes -


i have quiz have 4 options choose. every question have different options , option have long text doesn't fit in fixed size boxes (say div). don't want have largest possible box prevent overflow in boxes. want size box depended on longest option have in current quiz , if every option short enough use fixed sizes had.

this html markup:

<div id="options">     <div class="option 1">         <span class="optionttext"></span>     </div>     <div class="option 2">         <span class="optionttext"></span>     </div>     <div class="option 3">         <span class="optionttext"></span>     </div>     <div class="option 4">         <span class="optionttext"></span>     </div> </div> 

and css:

#options{ width:800px;} .option{width:380px; margin:10px;} 

text of optiontexts came database , want jquery function size boxes depended on size of text

it's better use jquery equal height plugin balance height of options.


Comments