...

View Full Version : Select Box



archanas
03-12-2009, 09:17 AM
Hi,

Is it possible to provid a horizontal scroll bar for the options list in a select box.
ie.. the values inside the select box-options...
I had tried placing the select inside the div ie..
<div style="overflow-x:scroll; width:500px;
overflow: -moz-scrollbars-horizontal;">
<select....></select>
</div>
the problem here is its for the select box and not for the options within.

Thanks in advance..
arsu

rangana
03-12-2009, 10:01 AM
I'm not sure if I totally understand you, but try:


<select multiple="multiple" size="5">
<option>Option1</option>
<option>Option2</option>
<option>Option3</option>
<option>Option4</option>
<option>Option5</option>
<option>Option6</option>
<option>Option7</option>
<option>Option8</option>
<option>Option9</option>
<option>Option10</option>
</select>

Philip M
03-12-2009, 10:15 AM
Hi,

Is it possible to provide a horizontal scroll bar for the options list in a select box.
ie.. the values inside the select box-options...


AFAIK, the answer is NO.

But the width of the select list will by default be the amount required to display the longest option.


<select>
<option value = "1">Lots of extremely lengthy and complicated stuff in here</option>
<option value = "2">x</option>
</select>

This width can be altered using CSS:-


<style type="text/css">
.widthsel{
width:100px;
}
</style>

<select class="widthsel">
<option value = "1">Lots of extremely lengthy and complicated stuff in here</option>
<option value = "2">x</option>
</select>



He thought he saw a Argument
That proved he was the Pope:
He looked again, and found it was
A Bar of Mottled Soap.
"A fact so dread," he faintly said,
"Extinguishes all hope!"
- Lewis Carroll

rangana
03-12-2009, 10:20 AM
Oops, I guess there's something wrong with my comprehension on horizontal and vertical :p

Thanks for the heads up Philip :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum