Skip to content

Instantly share code, notes, and snippets.

@zeropopular
Created September 19, 2015 01:36
Show Gist options
  • Save zeropopular/ffe73e8332e580a5f790 to your computer and use it in GitHub Desktop.
Save zeropopular/ffe73e8332e580a5f790 to your computer and use it in GitHub Desktop.

Revisions

  1. zeropopular created this gist Sep 19, 2015.
    21 changes: 21 additions & 0 deletions Scrolling Dropdown Buttons
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    For example your dropdown looks like this and has no scrollbar
    <select>
    <option value="1">One</option>
    <option value="2">two</option>
    <option value="3">Three</option>
    <option value="4">Four</option>
    <option value="5">Five</option>
    <option value="6">Six</option>
    </select>

    Put your list inside a DIV tag and set the DIV style overflow:auto and the DIV's height to a fixed height.

    <div style=overflow:auto>
    <option value="1">One</option>
    <option value="2">two</option>
    <option value="3">Three</option>
    <option value="4">Four</option>
    <option value="5">Five</option>
    <option value="6">Six</option>
    </select>
    </div>