Scroll bar in a select

Asked

Viewed 3,022 times

0

How to scroll a "scroll" to scroll in a select ? For example:

<select>
  <option>a</option>
  <option>b</option>
  <option>c</option>
  <option>d</option>
  <option>e</option>
  <option>f</option>
  <option>g</option>
</select>

There is how to put a scroll to the down box not getting too big ? Enves to list all below just 3 and then be able to scroll down.

  • Have you tried size="3"? ah if it is to select more than one place multiple

  • Have you tried using the select bootstrap plugin ?

  • No, I’m using Foundation as a framework.

  • It has an interesting feature to it, you can take a look at it. https://silviomoreto.github.io/bootstrap-select/

  • @Duke Put as answer then.

1 answer

3


select{
   overflow-y:auto;
}

<select size='3'>
  <option>a</option>
  <option>b</option>
  <option>c</option>
  <option>d</option>
  <option>e</option>
  <option>f</option>
  <option>g</option>
</select>

UPDATING

You can use the bootstrap select plugin, as I understand it, you want to control the height of the box that opens when you click on select. Bootstrap select has this feature, see:

The attribute used is the data-size

<select class="selectpicker" data-size="2">
  <option>Mustard</option>
  <option>Ketchup</option>
  <option>Relish</option>
</select>

Example running here: https://jsfiddle.net/aduque/zs2g2re3/

Bootstrap select has dependencies, they are: Jquery and Bootstrap

I hope you solve your problem now.

  • 1

    "To the box that goes down, "he said, namely to the drop down list, so this solution does not solve.

  • I understood Johnny, I didn’t quite understand what he meant.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.