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

六眼飞鱼酱① 提交于 2019-12-02 00:00:49

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.

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>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!