如何将以下样式添加到ListBox下面,
@Html.ListBoxFor(m => m.AvailableProducts, new MultiSelectList(Model.AvailableProducts, "Id", "Name", Model.AvailableSelected),
new Dictionary<string, object> { { "data-bind", "options:availableProducts, selectedOptions:availableSelected, optionsText:'Name'" } })
CSS
div.selectbox-wrapper ul {
list-style-type:none;
margin:0px;
padding:0px;
}
div.selectbox-wrapper ul li.selected {
background-color: #EAF2FB;
}
div.selectbox-wrapper ul li.current {
background-color: #CDD8E4;
}
div.selectbox-wrapper ul li {
list-style-type:none;
display:block;
margin:0;
padding:2px;
cursor:pointer;
}
答案 0 :(得分:0)
使用jQuery插件将<select>
元素更改为<div>
和<ul>
的{{1}}。