色尼玛亚洲综合影院,亚洲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 多選下拉框,轉載需保留來源!

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

主站蜘蛛池模板: 富平县| 雷州市| 潼南县| 彭阳县| 兴国县| 开远市| 东辽县| 绍兴市| 永兴县| 社旗县| 广汉市| 洛川县| 贵阳市| 始兴县| 黄龙县| 建湖县| 忻州市| 福泉市| 拜泉县| 六枝特区| 巨野县| 昌江| 广丰县| 连云港市| 太保市| 赤城县| 淮安市| 莲花县| 红原县| 九寨沟县| 武安市| 元朗区| 波密县| 三门峡市| 基隆市| 双鸭山市| 浑源县| 即墨市| 屏东市| 涡阳县| 宁明县|