jQuery Selectric下拉框菜单选择插件是一款包含多种样式的Select下拉选择代码。主要功能有,基本用法,获取选定的选项值,设定值,更改选项,回调,通过Ajax请求填充,下拉框的自定义标记,下拉框定义向上,下拉框定义向下等。
(下载的附件中附有DEMO)
<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script src="jquery.selectric.min.js"></script>
<link rel="stylesheet" href="selectric.css">
<select>
<option>北京市</option>
<option>上海市</option>
<option>南京市</option>
<option>广州市</option>
</select>
$(function() {
$('select').selectric();
});
$('select').selectric('open'); // 展开
$('select').selectric('close'); // 关闭
$('select').selectric('destroy'); // 摧毁,不可用
$('select').selectric('refresh'); // 刷新
$('select').selectric('init'); // Reinitialize the plugin
// 或者可以这样...
var Selectric = $('select').data('selectric');
Selectric.open(); //
Selectric.close(); //
Selectric.destroy(); //
Selectric.refresh(); //
Selectric.init();
官网地址 :http://selectric.js.org/
GitHub地址 :https://github.com/lcdsantos/jQuery-Selectric
在线演示:http://yanshi.sucainiu.com/demo/6846.html