jquery.multi-select.js操作

       $('#searchCity').multiSelect({
//            selectableOptgroup: true,//Click on optgroup will select all nested options when set to true.
//            keepOrder: true,
            afterSelect: function(values){
            	console.log("values:"+values.toString());
            	$.each(values,function(i,v){
            		if($.inArray(v,selectItem)<=-1){
            			selectItem.push(v);
            		}
            	});
            	console.log("afterSelect:"+selectItem.toString());
              },
          afterDeselect: function(values){
        	  selectItem.splice($.inArray(values,selectItem),1);
          }
        });

//最简单的使用方法
$('#searchCity').multiSelect();

//更多内容请看附件,附件中附有网页demo

你可能感兴趣的:(multiSelect)