jquery dialog鍵盤事件代碼
更新時間:2010年08月01日 15:52:57 作者:
jquery dialog鍵盤事件代碼,檢測回車等事件的觸發(fā)問題。
在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() {
}
});
復制代碼 代碼如下:
$("#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() {
}
});
您可能感興趣的文章:
相關文章
jQuery 獲取select選中值及清除選中狀態(tài)
這篇文章主要介紹了jQuery 獲取select選中值及清除選中狀態(tài)的相關資料,非常不錯,具有參考借鑒價值,需要的朋友可以參考下2016-12-12jQuery插件bgStretcher.js實現(xiàn)全屏背景特效
可以自動動態(tài)更換網(wǎng)頁背景圖片的jQuery插件bgstretcher.js,sharejs.com推薦的這個插件,可以自定義多種方式讓網(wǎng)頁背景自動切換,效果流暢,非常難得,調(diào)用代碼也非常簡單。2015-06-06