我正在使用GreyBox在同一窗口中打开一个新的 HTML 页面。它工作正常,但现在我希望它应该在按下转义键或用户单击页面上的其他位置时关闭。我怎样才能做到这一点?
编辑: - -
document.onkeypress = function (event) {
if (event == undefined) { event = window.event; }
if (event.keyCode == 27) {
AJS.AEV(document,"keypress",GB_hide);
}
}
我用过这个,它在 mozilla 上运行良好,但在 safari 或 chrome 上运行良好......知道为什么会这样吗?