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

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

主站蜘蛛池模板: 常宁市| 永善县| 彩票| 竹山县| 大庆市| 宣化县| 嘉善县| 江陵县| 沙洋县| 大安市| 板桥市| 汉阴县| 来凤县| 玛多县| 利川市| 申扎县| 威海市| 延川县| 泾源县| 和龙市| 从化市| 金塔县| 兴安盟| 仪征市| 高密市| 金山区| 全椒县| 湾仔区| 宁德市| 彰武县| 错那县| 河南省| 瑞金市| 贡嘎县| 韶山市| 咸阳市| 台北市| 海伦市| 临澧县| 阿拉尔市| 宁德市|