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

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

主站蜘蛛池模板: 新郑市| 横峰县| 杭锦后旗| 贵定县| 红原县| 托克逊县| 兴国县| 仙桃市| 三门县| 贵溪市| 寿阳县| 安平县| 屯门区| 临夏县| 兴义市| 郓城县| 阿瓦提县| 平潭县| 娱乐| 长乐市| 塘沽区| 依兰县| 阆中市| 河间市| 成武县| 交口县| 台州市| 启东市| 林西县| 盐池县| 互助| 大冶市| 屏东市| 毕节市| 铅山县| 鞍山市| 天水市| 堆龙德庆县| 墨玉县| 南宫市| 墨玉县|