亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

jQuery多選插件

系統(tǒng) 2103 0

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

?

?

?

jQuery多選插件

?

?

?

效果: demos

?

?

特性

  • 支持點(diǎn)擊label實(shí)現(xiàn)checkbox組選擇.
  • 頭部選項(xiàng),如全選/ 取消全選 /關(guān)閉功能.
  • 支持鍵盤選擇.
  • 支持5種不同的事件回調(diào)函數(shù).
  • 以列表方式顯示選中項(xiàng)目,并且可以設(shè)置最大顯示值.
  • 方便改變位置,漸變速度,滾動(dòng)容器的高度,鏈接文字,文本框默認(rèn)內(nèi)容等.
  • 最小版只有 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 . 我們?cè)谶@用的不是jQuery UI library本身,而是他的主題文件. 最簡(jiǎn)單的綁定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();
});
  
?

?

回調(diào)函數(shù)

?

比如其中的 onOpen 回調(diào)函數(shù), 如:

?

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

onClick 回調(diào)函數(shù). Example:

?

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

更多回調(diào)函數(shù)請(qǐng)看下面列表.

?

?

重載項(xiàng)

參數(shù)選項(xiàng)均在 $.fn.multiSelect.defaults中保存 , 你可以如下改變默認(rèn)選項(xiàng):

?

     // 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";
	}
});
  
?

?

參數(shù)

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多選插件


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

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

【本文對(duì)您有幫助就好】

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

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 一级毛片短视频 | 中国大陆一级毛片 免费 | 精品国产不卡一区二区三区 | 国产成人精品男人的天堂网站 | 99热自拍 | 四虎伊人 | 成人免费动作大片黄在线 | 国产首页精品 | 亚洲视频aaa| 国产这里有精品 | 欧美理伦| 亚洲天堂一区二区三区四区 | 久久久国产精品免费视频 | 亚洲综合色吧 | 国产99久久亚洲综合精品 | 四虎影视永久免费观看地址 | 色综合久久综合网欧美综合网 | 成人99国产精品一级毛片 | 国产四区 | 99热热久久这里只有精品166 | 日本亚州在线播放精品 | 在线成人天天鲁夜啪视频 | 亚洲性爰视频 | 夜夜爱夜夜做 | 亚洲欧美日韩高清一区二区三区 | 欧美视频在线观看免费 | www四虎| 久久久一区二区三区 | 国产2021久久精品 | 久久久国产精品免费 | 日日夜夜拍 | 久久精品国产亚洲精品2020 | 欧美一级在线播放 | 国产成人精品日本 | 91精品国产91久久久久青草 | 精品久久久中文字幕二区 | 99久久精品免费看国产一区二区 | 国产成人精品免费视频网页大全 | 国产精品亚洲精品 | jizz成熟丰满中国妇女 | 香蕉蕉亚亚洲aav综合 |