zl程序教程

您现在的位置是:首页 >  其他

当前栏目

jquerydialog键盘事件代码

事件代码 键盘 JQueryDialog
2023-06-13 09:14:23 时间
在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("enterpressed!");
}
});
},
buttons:{
"取消":function(){
$(this).dialog("close");
},
"搜索":function(){
}
},
close:function(){
}
});