vertical scrolling of disabled <select> mutliple element not working in IE

后端 未结 2 1734
臣服心动
臣服心动 2021-01-21 09:22

I have a select multiple element with scrollbars that is disabled. In Chrome and Firefox on Windows it is still scrollable but no selections can be made. However in IE its not s

相关标签:
2条回答
  • 2021-01-21 10:14

    Check this out.
    HTML:

    <div id="options">
    <select multiple size="5" style="height:165px" disabled>
        <option>value number 1</option>
        <option>val 2</option>
        <option>val 3</option>
        <option>val 4</option>
        <option>val 5</option>
        <option>value 6</option>
        <option>val 7</option>
        <option>val 8</option>
        <option>val 9</option>
        <option>val 10</option>
    </select>
    </div>
    

    CSS:

    #options {
        height:50px;
        width:115px;
        overflow-x:hidden;
    }
    

    Here is the fiddle: http://jsfiddle.net/2ET44/4/

    IE just behaves in an other way. You can fix this by using a div to handle the scrolling.

    0 讨论(0)
  • 2021-01-21 10:14

    Try disabling options rather than select

     <select size="5" style="height:100px" >
     <option disabled>value 1</option>
     <option disabled>value 2</option>
     <option disabled>value 3</option>
     <option disabled>value 4</option>
     <option disabled>value 5</option>
     <option disabled>value 6</option>
     <option disabled>value 7</option>
     <option disabled>value 8</option>
     </select>
    
    0 讨论(0)
提交回复
热议问题