jquery Sumoselect Plugin Implementation Select dropdown check box, which is written by foreign Daniel, refer to the following website:
Http://hemantnegi.github.io/jquery.sumoselect/sumoselect_demo.html Official Demo website
http://hemantnegi.github.io/jquery.sumoselect/official website of the method use instructions.
1. Only need to import JS and CSS, you can directly on the select to add a <select multiple= "multiple" class= "M-wrap span11 positionrank" id= "Positionrank" , the key is multiple= "multiple", you can use this drop-down check box, the way to use the following:
$ (document). Ready (function () {
$ ('. Slectbox '). Sumoselect ({
placeholder: ' This is a placeholder ',
csvdispcount:3
});
The result of the operation is:
These styles, there are more complex selection of groups, if you want to get the value of the selected values, I am writing to traverse each of the selected, and then use, comma split, passed to the background, and then into the array, the following code: (in the official website does not see the method to get the selected value, a friend know can tell me):
[JavaScript] view plain copy//========== traversal multi-select =============== var positionrankselectspilt = ""; $ ("#positionRank option:selected"). each (function () {positionrankselectspilt + = $ (this). Val () + ","; }); Multiple selection of ranks remove the last comma positionrankselectspilt = positionrankselectspilt.substring (0,positionrankselectspilt.length-1); Alert ("Selected:" +positionrankselectspilt); //=====================================
======================== Split Line, December 15, 2016 09:39:53====================
This sumoselect has a very serious bug is that if you use his multi-box control, the drop-down text is actually in the background, assuming that the box above, there is just a button below, will be blocked caused by the click, found not the reason behind the plugin, did not find the reason, This site test is also good, a little do not understand, expect the great God to answer
Note: There are other components:
Controls for multi-marquee:
Selectboxit can be used to replace the ugly and hard-to-use box in HTML with a nice-looking, multi-drop-down option. Twitter's Bootstrap, jQueryUI, and jQuery Mobile themes support Selectboxit. Selectboxit provides first-class support for mobile phones, tablets, and desktop browsers.
http://gregfranko.com/jquery.selectBoxIt.js/
Http://www.oschina.net/news/63891/15-jquery-selectbox-plugins?utm_source=tuicool
http://www.jq22.com/jquery-info11378