how to make a drop down menu with a vertical scroll bar?
-
hi i need to put a vertical scroll bar in the drop down menu such that at first it will appear only size=1 but when we drop down it should have a vertical scroll bar , can anybody help me , i would really appreciate any help
-
Answer:
If you use the html-dropdownbox, Natrium suggested, you can set the attribute "size" of the select tag, to specify how many lines you want to show. So if - in his example - you set size to 3, you'd have the dropdownbox 3 lines high and a scrollbar attached to scroll down to the remaining 3 items. If you mean something with CSS, say you display your dropdown-menu in a div-tag, you could use something like that: <div style="height:200px; overflow-y:scroll">...</div> This gives you a div with an absolute height. If the content of the div gets too big, a vertical scroll bar is displayed automatically.
jarus at Stack Overflow Visit the source
Other answers
If you mean you want to force the scrollbar to be always visible, you just can't do that with the native select drop down. The visibility of the scrollbar in the native control depends on the number of the entries in the drop down and there are also differences between browsers on how they handle the control. For example, IE6 and IE7 seem to show the scrollbar only when the number of items exceeds 30 whereas FF3 and Chrome show the scrollbar when the number of the items exceeds 20. If you really, really want to always get the scrollbar, you'll have to use some non-native implementation, like the http://www.fairwaytech.com/flexbox/Default.aspx.
kkyy
isn't that just an html-dropdownbox that you need? <select name="cars"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="fiat">Fiat</option> <option value="audi">Audi</option> <option value="volkswagen">Volkswagen</option> <option value="bmw">Bmw</option> </select>
Natrium
Related Q & A:
- How to check if drop down menu of ActionBar is active?Best solution by Stack Overflow
- Dose anyone know how to make a toga without cutting a sheet?Best solution by Yahoo! Answers
- How to make a drop-in ramp for snowboarding?Best solution by Yahoo! Answers
- How to become a drop shipper?Best solution by Yahoo! Answers
- How do make a website and make money from it?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.