My challenge is to create a drop-down list that displays the first four items with a vertical scrollbar when the user clicks on it. The remaining items should be visible as the user scrolls through the list.
You can find a sample fiddle here: http://jsfiddle.net/db8Lp/105/
I am seeking suggestions on how I can achieve this functionality using a combination of JavaScript and CSS. Being new to programming, any advice or guidance would be greatly appreciated.
I have attempted using size="4"
in the <select>
tag, but this displays the list with a scrollbar when the page loads. My goal is for the scrollbar to only appear when the dropdown list is clicked by the user. Please advise.