色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

jquery multiSelect 多選下拉框

$("#id").multiSelect({ oneOrMoreSelected: '*',selectAll:false,noneSelected:'默認顯示' });
Usage: $('#id').multiSelect( options, callback )
Options: selectAll - whether or not to display the Select All option; true/false, default = true
selectAllText - text to display for selecting/unselecting all options simultaneously
noneSelected - text to display when there are no selected items in the list
oneOrMoreSelected - text to display when there are one or more selected items in the list
(note: you can use % as a placeholder for the number of items selected).
Use * to show a comma separated list of all selected; default = '% selected'
optGroupSelectable - whether or not optgroups are selectable if you use them; true/false, default = false
listHeight - the max height of the droptdown options
復制代碼 代碼如下:
// Update the textbox with the total number of selected items, and determine select all
$("#id").updateSelected()
// Update the dropdown options
$("#id").multiSelectOptionsUpdate()
// Hide the dropdown
$("#id").multiSelectOptionsHide()
// Show the dropdown
$("#id").multiSelectOptionsShow()
// get a coma-delimited list of selected values
$("#id").selectedValuesString

使用Javascript 設置多選框的默認選中項。
復制代碼 代碼如下:
$("#id").attr("value","");//清空選中項。
var ids='1,3,6';//設置選中框ID。
var id_Ojbect=(ids).split(",");//分割為Ojbect數組。
var count=$("#id option").length;//獲取下拉框的長度。
for(var c=0;c<id_Ojbect.length;c++){
for(var c_i=0;c_i<count;c_i++)
{
if($("#id").get(0).options[c_i].text == id_Ojbect[c])
{
$("#id").get(0).options[c_i].selected = true;//設置為選中。
}
}
}

代碼打包下載

JavaScript技術jquery multiSelect 多選下拉框,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 屏边| 彩票| 庆安县| 潢川县| 开化县| 淮安市| 保德县| 石门县| 揭东县| 漳平市| 古浪县| 黔南| 益阳市| 思茅市| 西青区| 涟水县| 逊克县| 田东县| 定结县| 赞皇县| 鸡东县| 德化县| 涡阳县| 东海县| 峨眉山市| 金门县| 南江县| 武平县| 喀喇| 石台县| 潼关县| 西丰县| 日照市| 长海县| 江永县| 即墨市| 庆云县| 灵石县| 宿州市| 新余市| 漳浦县|