0
將jQuery對話框設置爲closeOnescape爲false。想要觸發一個基於esc鍵的事件,我該如何實現它? 這對還沒有工作針對jQuery對話框的esc鍵事件
$(document).on("keypress","#popupid",function(e) {
debugger;
if (e.keycode === 27) {
alert("esc key triggered");
}
});
放警報;警報(e.keycode),並檢查這是什麼給這 –
esc鍵代碼是27,你正在使用 –
http://stackoverflow.com/questions/1160008/which-keycode-for-escape-key-with-jquery – sarepta