最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jquery multiSelect 多選下拉框

 更新時間:2010年07月09日 00:45:15   作者:  
jquery multiSelect 多選下拉框?qū)崿F(xiàn)挨罵
$("#id").multiSelect({ oneOrMoreSelected: '*',selectAll:false,noneSelected:'默認(rèn)顯示' });
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
復(fù)制代碼 代碼如下:

// 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 設(shè)置多選框的默認(rèn)選中項。
復(fù)制代碼 代碼如下:

$("#id").attr("value","");//清空選中項。
var ids='1,3,6';//設(shè)置選中框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;//設(shè)置為選中。
}
}
}

代碼打包下載

相關(guān)文章

最新評論

涞水县| 龙岩市| 伊春市| 巴楚县| 平定县| 两当县| 白银市| 河津市| 怀远县| 宁河县| 新邵县| 洛宁县| 疏勒县| 阳山县| 昌图县| 赣州市| 宕昌县| 庆元县| 祁门县| 武鸣县| 前郭尔| 丰原市| 临清市| 台湾省| 射阳县| 西和县| 安陆市| 巴林左旗| 合江县| 新源县| 田阳县| 湘潭市| 景德镇市| 信丰县| 临朐县| 南汇区| 深水埗区| 盘山县| 凤山市| 章丘市| 永清县|