替换系统的下拉菜单<select>,用上美观的dropdown,效果图
1. 引入文件
public/img/js/lib/cmstop.dropdown.js
public/img/js/lib/dropdown/style.css
2. 初始化
html代码
<select>
<option> option1 </option>
<option> option2 </option>
<option> option3 </option>
<option> option4 </option>
</select>
JS代码
$(select).dropdown( /*Hash*/{
selected:<mixed>, // default value was select
onchange:function(value,text){}, // 改变值时触发
title:<string>,// 未选中任何值的标题
marginLeft:<int>,// 弹出层左偏离显示框
marginTop:<int> //弹出层上偏离显示框
} /*[, Array/HtmlSelectElement]*/[
{text:<string>, value:<mixed>, ico:<string>, selected:<bool>, onselect:<function>},
{text:<string>, value:<mixed>, ico:<string>, selected:<bool>, onselect:<function>} [,.....]
]);