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

jquery multiSelect 多選下拉框

 更新時(shí)間: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)選中項(xiàng)。
復(fù)制代碼 代碼如下:

$("#id").attr("value","");//清空選中項(xiàng)。
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)文章

最新評(píng)論

大埔县| 永吉县| 绥芬河市| 鲁甸县| 冕宁县| 江阴市| 兴和县| 水富县| 法库县| 伊通| 浙江省| 祁连县| 文成县| 博罗县| 同德县| 呼和浩特市| 佳木斯市| 自治县| 赤城县| 武夷山市| 兴仁县| 青龙| 榆树市| 大田县| 西华县| 贺州市| 凭祥市| 岑巩县| 镇远县| 乐至县| 延长县| 马尔康县| 兴义市| 沐川县| 龙里县| 贵港市| 临桂县| 潞西市| 上林县| 樟树市| 涞源县|