Home > Web Front-end > JS Tutorial > body text

jquery dialog keyboard event code_jquery

WBOY
Release: 2016-05-16 18:22:13
Original
880 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!