jquery dialog键盘事件代码

2019-12-24,,,,

在dilog的open事件中 添加如下代码段
复制代码 代码如下:
$("#dlgSearch").dialog({
autoOpen: false,
bgiframe: true,
width: 600,
//height: 225,
modal: true,
resizable: false,
open: function() {
//jquery之dialog的键盘事件(输入完毕回车检索)
$(this).bind("keypress.ui-dialog", function(event) {
if (event.keyCode == $.ui.keyCode.ENTER) {
alert("enter pressed!");
}
});
},
buttons: {
"取消": function() {
$(this).dialog("close");
},
"搜索": function() {
}
},
close: function() {
}
});

您可能感兴趣的文章:

  • dialog dismiss时键盘不消失的问题浅析及解决办法

《jquery dialog键盘事件代码.doc》

下载本文的Word格式文档,以方便收藏与打印。