Select drop-down box plug-in jquery. editable-select, jqueryselect drop-down box
There is a requirement in the project. You can select from the drop-down list or enter
Html code
1 <span> data source </span> 2 <select class = "source"> 3 <option value = "0"> manual import </option> 4 <option value =" 1 "> data service platform </option> 5 </select>
Js Code
1 $ ('# noMean '). editableSelect ({2 filter: false, 3 effects: 'fade ', 4 duration: 200, 5 onCreate: function () {6 console. log ("create from the drop-down list") 7}, 8 onShow: function () {9 console. log ("show in the drop-down box") 10}, 11 onHide: function () {12 console. log ("hidden from the drop-down list") 13}, 14 onSelect: function () {15 console. log ("drop-down box option selected") 16} 17 18}
Get value
$(".noMean").val()
With this plug-in, this is an input, type = "text"
Parameters
Whether to filter true by default after option is selected for filter
When you click effects, the transition effects of the drop-down box are default, slide, and fade. The default value is default.
The default duration transition effect time can be fast, slow, or numeric.
AppendTo drop-down box. If the pop-up box shows the effect, this value will be used to show where to load it.
The trigger drop-down list shows how the trigger value is"focus"
,The default value of "manual" is focus.
Method
OnCreate: WhenTriggered when the editableSelect method is activated.
.
OnShow: Triggered when the drop-down box appears.
OnHide: Triggered when the drop-down box is hidden.
OnSelect: Triggered when the options in the drop-down list are selected.
Reference address:
Https://www.npmjs.com/package/jquery-editable-select npm Installation
Http://indrimuska.github.io/jquery-editable-select/ demo address
Https://github.com/zhaobao1830/jquery-editable-select