做网站|网站建设,就上易助科技网

前端技术文档及相关资料下载

关于前端html、css、js等技术上的各种疑难棘手问题的解决方案探讨及相关资料下载!

JQuery下拉框菜单选择插件s e l e c t r i c
来源:易助科技网浏览量:4收藏

简介

jQuery Selectric下拉框菜单选择插件是一款包含多种样式的Select下拉选择代码。主要功能有,基本用法,获取选定的选项值,设定值,更改选项,回调,通过Ajax请求填充,下拉框的自定义标记,下拉框定义向上,下拉框定义向下等。

(下载的附件中附有DEMO)


使用

1.  引入文件

<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">


2.  HTML

<select>
<option>北京市</option>
<option>上海市</option>
<option>南京市</option>
<option>广州市</option>
</select>


3.  调用

$(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