没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
试读
2页
一直在用Chosen这个js插件,其目的就是美化下拉框。github地址:https://harvesthq.github.io/chosen/ no_results_text:”xxxxx”无搜索结果时显示的文本 allow_single_deselect:true 是否允许取消选择 disable_search: true 是否有搜索框出现 max_selected_options:当select为多选时,最多选择个数 官方说明文档地址 配置选项的官方说明文档地址 /* 功能: Chosen通用初始化 * 创建人:Brian 创建时间:2016-12-13 */ (function
资源详情
资源评论
资源推荐
jQuery Chosen通用初始化通用初始化
一直在用Chosen这个js插件,其目的就是美化下拉框。github地址:https://harvesthq.github.io/chosen/
no_results_text:”xxxxx”无搜索结果时显示的文本
allow_single_deselect:true 是否允许取消选择
disable_search: true 是否有搜索框出现
max_selected_options:当select为多选时,最多选择个数
官方说明文档地址
配置选项的官方说明文档地址
/* 功能: Chosen通用初始化
* 创建人:Brian 创建时间:2016-12-13
*/
(function ($j) {
var chosenTool = function (el, options) {
this.opts = options;
this.chosenInit();
this.chose_get_init();
this.chose_mult_set_init(this.opts.hidClassName);
this.clickEvent();
return this;
}
chosenTool.opts = {
selectId: '',//selectId
hidClassName: '',//隐藏域Class
placeholdertxt: '',//select中placeholder文字
noresulttxt: '',//输入的名称未查到时显示的文字
dataJson: ''//数据源
};
$j.fn.myChosenTool = function (opt) {
var value,
args = Array.prototype.slice.call(arguments, 1);
var $jthis = $j(this),
data = $jthis.data('chosenTool'),
options = $j.extend({}, chosenTool.opts, $jthis.data(),
typeof option === 'object' && option);
if (typeof option === 'string') {
//判断用户调用的方法是否存在
//if ($j.inArray(option, allowedMethods) < 0) {
// throw new Error("Unknown method: " + option);
//}
if (!data) {
return;
}
value = data[option].apply(data, args);
if (option === 'destroy') {
$jthis.removeData('chosenTool');
}
}
/*插件外部调用插件内部的方法需要修改成下面形式*/
//if (typeof opt === 'string') {
// if (!data) {
// return;
// }
// value = data[opt].apply(data, args);
// if (opt === 'destroy') {
// $jthis.removeData('chosenTool');
// }
//}
if (!data) {
opt["selectId"] = $j(this).attr("id");
$jthis.data('chosenTool', (data = new chosenTool(this, opt)));
}
console.log(data);
return typeof value === 'undefined' ? this : value;
};
chosenTool.prototype.clickEvent = function () {
var _this = this;
$j("#" + this.opts.selectId).on("change", function () {
_this.chose_get_value();
});
};
weixin_38667207
- 粉丝: 3
- 资源: 965
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Screenshot_20240427_031602.jpg
- 网页PDF_2024年04月26日 23-46-14_QQ浏览器网页保存_QQ浏览器转格式(6).docx
- 直接插入排序,冒泡排序,直接选择排序.zip
- 在排序2的基础上,再次对快排进行优化,其次增加快排非递归,归并排序,归并排序非递归版.zip
- 实现了7种排序算法.三种复杂度排序.三种nlogn复杂度排序(堆排序,归并排序,快速排序)一种线性复杂度的排序.zip
- 冒泡排序 直接选择排序 直接插入排序 随机快速排序 归并排序 堆排序.zip
- 课设-内部排序算法比较 包括冒泡排序、直接插入排序、简单选择排序、快速排序、希尔排序、归并排序和堆排序.zip
- Python排序算法.zip
- C语言实现直接插入排序、希尔排序、选择排序、冒泡排序、堆排序、快速排序、归并排序、计数排序,并带图详解.zip
- 常用工具集参考用于图像等数据处理
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0