欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

jQuery多選插件

系統 2231 0

下載地址: http://github.com/ehynds/jquery-multiselect

?

?

?

jQuery多選插件

?

?

?

效果: demos

?

?

特性

  • 支持點擊label實現checkbox組選擇.
  • 頭部選項,如全選/ 取消全選 /關閉功能.
  • 支持鍵盤選擇.
  • 支持5種不同的事件回調函數.
  • 以列表方式顯示選中項目,并且可以設置最大顯示值.
  • 方便改變位置,漸變速度,滾動容器的高度,鏈接文字,文本框默認內容等.
  • 最小版只有 6.9kb.

兼容性

  • Firefox 2 – 3.6
  • IE 6 – 8
  • Chrome Beta/4
  • Safari 4
  • Opera 10

用法

首先需要引入 jquery 1.4、jQuery UI theme, 和 jquery.multiselect. css . 我們在這用的不是jQuery UI library本身,而是他的主題文件. 最簡單的綁定select box方法:

?

    <select id="MySelectBox" multiple="multiple" name="MySelectBox"> <option value="1">Option 1</option> <option value="2">Option 2</option></select>

  
?
    $(document).ready(function(){
    $("#MySelectBox").multiSelect();
});
  
?

?

回調函數

?

比如其中的 onOpen 回調函數, 如:

?

    $("#MySelectBox").multiSelect({
	onOpen: function(){
		var $checkboxes = $(this).find('input');
	}
});
  
?

onClick 回調函數. Example:

?

    $("#MySelectBox").multiSelect({
	onClick: function(){
		if(this.checked){
			alert("I was just checked!");
		}
	}
});
  
?

更多回調函數請看下面列表.

?

?

重載項

參數選項均在 $.fn.multiSelect.defaults中保存 , 你可以如下改變默認選項:

?

     // set the minWidth parameter for all instances to 500 pixels
$.fn.multiSelect.defaults.minWidth = 500;
  
?

?

Passing a function to the selectedText parameter

As of 0.5, the selectedText parameter can accept an anonymous function with three arguments: the number of checkboxes checked, the total number of checkboxes, and an array of the checked checkbox DOM elements. As you can see in the example, this gives you 100% control of the display:

?

    $("#MySelectBox").multiSelect({
	selectedText: function(numChecked, numTotal, checkedInputs){

		// example: emulating the default behavior
		return numChecked + " checked"; 

		// example: emulating the selectedList option
		return (numChecked < = 5)
			? checkedInputs.map(function(element){ return element.title; }).join(', ')
			: numChecked + " checked";
	}
});
  
?

?

參數

Parameter Description Default
showHeader A boolean value denoting whether or not to display the header containing the check all, uncheck all, and close links. true
maxHeight The maximum height in pixels of the scrolling container that holds the checkboxes. 175
minWidth The minimum width in pixels of widget. Setting to auto (default) will inherit the width from the original select element. 200
checkAllText The default text of the “Check all” link. Check all
unCheckAllText The default text of the “Uncheck all” link. Uncheck all
noneSelectedText
Renamed from noneSelected in 0.5!

The default text the select box when no options have been selected.

Select options
selectedList A boolean/numeric value denoting whether or not to display the checked opens in a list, and how many. A number greater than 0 denotes the maximum number of list items to display before switching over to the selectedText parameter. A value of 0 or false is disabled. false
selectedText The text to display in the select box when options are selected (if selectedList is false). The pound sign (#) is automatically replaced by the number of checkboxes selected. If two pound signs are present in this parameter, the second will be replaced by the total number of checkboxes available. Example: “# of # checked”.
New in 0.5!

As of 0.5, this parameter can also accept an anonymous function with three arguments: the number of checkboxes checked, the total number of checkboxes, and an array of the checked checkbox DOM elements. See the examples.

# selected
position The position of the options menu relative to the input control: top, middle, or bottom. bottom
shadow A boolean value denoting whether to apply a css shadow (class ui-multiselect-shadow). false
fadeSpeed How fast (in ms) to fade out the options menu on close. 200
state
New in 0.5!

The default state of the widget. Either open or closed.

closed
disabled
New in 0.5!

Whether or not to disabled the widget by default. Important: see the “Known Issues” section below for more documentation on this.

false
onCheck A callback to fire when a checkbox is checked. Function
onOpen A callback to fire when the options menu is opened. Function
onCheckAll A callback to fire when the “Check all” link is clicked. Function
onUncheckAll A callback to fire when the “Uncheck all” link is clicked. Function
onOptgroupToggle A callback to fire when the opgroup header is clicked. An array of checkboxes inside the optgroup is passed as an optional argument. Function

?

?

jQuery多選插件


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 精品亚洲国产成av人片传媒 | 国产日本三级欧美三级妇三级四 | 59pao成国产成视频永久免费 | 奇米影视8888| 欧美亚洲国产第一页草草 | 多女多p多杂交视频在线观看 | 免费欧美黄色网址 | 午夜影院在线观看 | 色婷婷久久久亚洲一区二区三区 | 久久久久国产精品免费免费搜索 | 夜夜夜操操操 | 九九这里只有精品视频 | 亚洲三级视频 | 欧美日韩中文 | 日韩精品一区二区三区在线观看 | 亚洲欧美日韩中文字幕在线一区 | 亚洲蜜桃AV色情精品成人 | 欧美亚洲欧美区 | 亚洲一区二区三区福利在线 | 9久9久女女热精品视频免费观看 | 亚洲国产日韩欧美高清片a 高清视频在线播放 | 中国人免费的片 | 久久精品91久久久久久再现 | 黄色av电影在线播放 | 亚洲欧洲精品一区二区 | 男女爽爽无遮挡午夜动态图 | 狠狠狠狠操 | 午夜小视频免费 | 午夜在线观看视频 | 国产乱码一区二区三区四 | 欧美一级爆毛片 | 草草视频在线观看 | 日本高清在线免费 | 亚洲一区二区三区久久久 | 奇米777me| 国产无线乱码一区二三区 | 国产精品久久久久国产精品 | 午夜视频在线 | 欧美高清在线精品一区 | 乱子伦xxxxvideos | av毛片|