jQuery Chosen 使用

jQuery Chosen 使用

 

 

1.  jQuery Chosen 选择框下拉值重置;

1
2
3
4
//重置
$( "#easySelBrands" ).val( "默认值" ).trigger( "chosen:updated" );
 
        

  赋值为默认值后要用trigger("chosen:updated")更新,否则无效;

 

 

2. 多个select在一起的问题

在chosen.jquery.js中找到此方法:

复制代码
1 Chosen.prototype.activate_field
2  = function()
3  {
4     this.container.addClass("chzn-container-active");
5     this.active_field
6  = true;      
7     this.search_field.val(this.search_field.val());
8     return this.search_field.focus();
9 };
复制代码

将此方法改为:

复制代码
1  Chosen.prototype.activate_field = function() {
2       this.container.addClass("chosen-container-active");
3       this.active_field = true;
4       this.search_field.val(this.search_field.val());
5       var zindex = 1010;
6       this.container.css('z-index', '1010')
7       $('.chosen-container').not(this.container).css('z-index', --zindex);
8       return this.search_field.focus();
9     };
复制代码

 

 

参考链接

https://github.com/amazeui/chosen/blob/master/docs/options.md

http://blog.csdn.net/iamduoluo/article/details/11519909

转载于:https://www.cnblogs.com/cjm123/p/10538853.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值