According to the requirements to achieve through the keyboard move up and down, get the value of the Lenovo menu, as Google Baidu query function.
Looking for a long time on the internet can not find to achieve the function of plug-ins, but only to do their own to change the code.
Find the Key.down and KEY in JS. Up Execution Code
As follows:
Copy Code code as follows:
Case KEY. Down:
Event.preventdefault ();
if (select.visible ()) {
Select.next ();
}
else {
OnChange (0, true);
}
Break
After the Select.next ();
Copy Code code as follows:
var selected = select.selected ();
var v = selected.result;
$input. Val (v);
In this way, the input box will have the corresponding value when the key is added, but the cursor on the keyboard is missing.
Find Select.next (); Definition of code
Copy Code code as follows:
Next:function () {
Moveselect (1);
},
To add a similar method
Copy Code code as follows:
Stay:function () {
Moveselect (1);
},
And then
Copy Code code as follows:
Case KEY. Down:
Event.preventdefault ();
if (select.visible ()) {
Select.next ();
var selected = select.selected ();
var v = selected.result;
$input. Val (v);
Select.stay ();
}
else {
OnChange (0, true);
}
Break
That's it.
================================
Thank the original author very much,
To add a similar method
Copy Code code as follows:
Stay:function () {
Moveselect (1);
When you click the up and down keys, you move the interlace, so instead:
Stay:function () {
Moveselect (0);
},