JQuery: expanding the selection option when it hangs

How can I open / open a selection option on mouseover using jquery to show all items in a select list?

<select size="3" id="something"> <option value="1">.1..</option> <option value="2">.2..</option> <option value="3">.3..</option> </select> 
+4
source share
1 answer

You mean something like this.

 $('select').hover(function(){ var count = $(this).children().length; $(this).attr('size', count); },function(){ $(this).removeAttr('size'); }); 

This will add and remove the size attribute when the selection is frozen. See fiddle .

+7
source

All Articles