Home > Web Front-end > JS Tutorial > jquery dialog keyboard event code_jquery

jquery dialog keyboard event code_jquery

WBOY
Release: 2016-05-16 18:22:13
Original
904 people have browsed it

Add the following code segment in the open event of dilog

Copy the code The code is as follows:

$( "#dlgSearch").dialog({
autoOpen: false,
bgiframe: true,
width: 600,
//height: 225,
modal: true,
resizable : false,
open: function() {
//Keyboard event of jquery’s dialog (retrieve by pressing enter after inputting)
$(this).bind("keypress.ui-dialog", function( event) {
if (event.keyCode == $.ui.keyCode.ENTER) {
alert("enter pressed!");
}
});
},
buttons: {
"Cancel": function() {
$(this).dialog("close");
},
"Search": function() {
}
},
close: function() {
}
});

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template