我试图制作一个下拉式滚动条。但事情并没有解决。选择框中的Scollbar没有出现
因此,这里的样机:
<div class="form-group">
<div id="fixedHeightDropDownContainer">
<label class="control-label">@Resources.IntrusionGroup</label>
<select name="intGroup1" id="intGroup1" class="form-control" tabindex="10" data-bind="options: $root.intGroups, optionsText: 'Name', optionsValue: 'Id',optionsCaption: '--Select--',value:$data.IntGroupName"></select>
</div>
<a href="#" class="ispicon ispicon_plus" data-toggle="modal" data-target="#addSchedule" data-bind="click:$parent.addGroup" title="Create New">Create New</a>
</div>
现在我试着在CSS:
div#fixedHeightDropDownContainer {
height: 100px !important;
width:auto !important;
overflow-y:auto !important;
background-color:red;
}
但没有奏效。我将样式应用于div,但保留了下拉选项。
然后我尝试:
#intrusionGroup1{
height: 100px !important;
width:auto !important;
overflow-y:auto !important;
background-color:red;
}
但也搞砸了UI。现在选择选项本身具有高度,而不是选项菜单。
怎样才可以解决吗?
谢谢。
不可能扩大下拉。你必须做一些multiselect插件或为它编写jQuery代码。 –
看看这篇文章http://stackoverflow.com/questions/24119643/html-select-tag-show-verticle-scroll-with-10-option –