jQuery对话框阻止Firefox热键 [英] jQuery Dialog blocks Firefox hotkeys

查看:102
本文介绍了jQuery对话框阻止Firefox热键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用jQuery 1.4.2和jQuery UI 1.8.2.

I'm currently working with jQuery 1.4.2 and jQuery UI 1.8.2.

我关闭了一个模态对话框后,我遇到了一些奇怪的行为. 当我尝试使用Ctrl + F5重新加载页面时,没有任何反应. 另一个奇怪的事情是,只有右键单击两次才能打开Firefox的上下文菜单.

I'm experiencing some weird behavior after I have closed a modal dialog. When I try to reload the page with Ctrl+F5 nothing happens. Another weird thing is that the context menu of Firefox can only be opened with right clicking twice.

当我按Ctrl键时,Firebug控制台向我显示以下消息: 不应使用keydown事件的'charCode'属性.该值没有意义.

The Firebug console is showing me the following message when I press the Ctrl key: The ‘charCode’ property of a keydown-event should not be used. The value is meaningless.

演示页面: http://testing.allinonesoftware.com/jquery/index.php

卢克

推荐答案

这是预期的行为...但是 在这里与浏览器有所不同. Firefox不会在打开对话框时集中精力.

This is the intended behavior...however there is a browser difference here. Firefox is not focusing inside your dialog on open.

如果您单击模式的外部,然后在任何其他浏览器中尝试 F5 ,效果相同,无需刷新.
另外,如果您在Firefox的模式中单击内部,则您的 F5 也可以使用.

If you click outside the modal and try F5 in any other browser, same effect, no refresh.
Also, if you click inside the modal with Firefox, your F5 will work.

要使这种行为在所有浏览器中保持一致,请在打开对话框时将元素置于焦点上,或者如果需要的话,将其中一个按钮作为焦点...只要将按键放在其中,两个按钮的作用相同对话框.

To make this behavior consistent across browsers, focus the element you're making the dialog on open, or if you want, focus one of the buttons...either will have the same effect, as long as the keypress goes inside the dialog.

对于错误消息:

不应使用keydown事件的'charCode'属性.该值没有意义.

The ‘charCode’ property of a keydown-event should not be used. The value is meaningless.

这就是jQuery做某些事情的方式,您可以忽略它...对您当前的问题没有影响.

This is just how jQuery does some things, you can ignore it...it has no impact on your current issue.

这篇关于jQuery对话框阻止Firefox热键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆