Is it possible to hide select options inside the window? IE, FF, Chrome behave the same way
overflow:hidden doesn't work.
Is it possible to hide select options inside the window? IE, FF, Chrome behave the same way
overflow:hidden doesn't work.
I don't think there is much you can do about it.
either, you can increase the width of your dropdown according to the longest option
or you can clip the text of the longest option, to make it small.
something like
$('select option').each(function(a,b){
if(b.value.length > 10){
b.text= b.text.substring(0, 10)+ a+ '..';
}
});
or you can create your own select, using divs
:)
probably use third party stylish dropdowns.
see this fiddle, an ugly 5mins implementation of such a dropdown by me i.e
create a markup like this:
<ul class="parent">
<li>---Select---</li>
</ul>
<ul class="option" >
<li>this is a long option</li>
<li>this is a even long option</li>
<li>this is a very long option</li>
<li>this is a very long option</li>
<li>this is a very long option</li>
<li>this is a very long option</li>
</ul>
and beautify it by css and jquery
I don't think you can use css to prevent it from going outside the browser window like that. (I am not positive).
However, you can use jquery ui autocomplete or something similar that styles the select options as a div and then it will stay within the window.