插件描述:Combo Select 是一款友好的 jQuery 下拉框插件,在 PC 浏览器上它能模拟一个简单漂亮的下拉框,在 iPad 等移动设备上又能回退到原生样式。Combo Select 可以对选项进行检索过滤,同时支持键盘控制。css
一、引入文件jquery
<
link
rel
=
"stylesheet"
href
=
"css/combo.select.css"
>
浏览器
<
script
src
=
"js/jquery.min.js"
></
script
>
spa
<
script
src
=
"js/jquery.combo.select.js"
></
script
>
插件
二、HTMLcode
<div class=
"jq22"
>
ip
<select>
ci
<option value=
""
>月份</option>
字符串
<option value=
"一月"
>一月</option>
input
<option value=
"二月"
>二月</option>
<option value=
"三月"
>三月</option>
...
</select>
</div>
三、JavaScript
$(
function
() {
$(
'select'
).comboSelect();
});
属性/方法 | 类型 | 默认值 | 说明 |
comboClass | 字符串 | combo-select | 外部控制器的 class |
comboArrowClass | 字符串 | combo-select-arrow | 箭头的 class |
comboDropDownClass | 字符串 | combo-drop-down | 下拉展开后箭头的 class |
inputClass | 字符串 | combobox-input text-input | 输入框的 class |
disabledClass | 字符串 | option-disabled | 禁用选项的 class |
hoverClass | 字符串 | option-hover | 鼠标通过的 class |
selectedClass | 字符串 | option-selected | 被选中项的 class |
markerClass | 字符串 | combo-marker | 匹配搜索的 class |
maxHeight | 整数 | 200 | 最大高度 |
themeClass | 字符串 | 空 | 使用外部主题 |
extendStyle | 布尔值 | true | true |
生成后的下拉框的 HTML 以下:
1 2 3 4 5 6 7 8 |
|