<i id='jD9k8'><tr id='jD9k8'><dt id='jD9k8'><q id='jD9k8'><span id='jD9k8'><b id='jD9k8'><form id='jD9k8'><ins id='jD9k8'></ins><ul id='jD9k8'></ul><sub id='jD9k8'></sub></form><legend id='jD9k8'></legend><bdo id='jD9k8'><pre id='jD9k8'><center id='jD9k8'></center></pre></bdo></b><th id='jD9k8'></th></span></q></dt></tr></i><div id='jD9k8'><tfoot id='jD9k8'></tfoot><dl id='jD9k8'><fieldset id='jD9k8'></fieldset></dl></div>

      1. <small id='jD9k8'></small><noframes id='jD9k8'>

        • <bdo id='jD9k8'></bdo><ul id='jD9k8'></ul>
        <legend id='jD9k8'><style id='jD9k8'><dir id='jD9k8'><q id='jD9k8'></q></dir></style></legend><tfoot id='jD9k8'></tfoot>

      2. jQuery .keypress &amp;.keydown .which

        时间:2023-09-07
      3. <small id='IOTiW'></small><noframes id='IOTiW'>

            <tbody id='IOTiW'></tbody>
            <bdo id='IOTiW'></bdo><ul id='IOTiW'></ul>
            <legend id='IOTiW'><style id='IOTiW'><dir id='IOTiW'><q id='IOTiW'></q></dir></style></legend>

              <tfoot id='IOTiW'></tfoot>

            1. <i id='IOTiW'><tr id='IOTiW'><dt id='IOTiW'><q id='IOTiW'><span id='IOTiW'><b id='IOTiW'><form id='IOTiW'><ins id='IOTiW'></ins><ul id='IOTiW'></ul><sub id='IOTiW'></sub></form><legend id='IOTiW'></legend><bdo id='IOTiW'><pre id='IOTiW'><center id='IOTiW'></center></pre></bdo></b><th id='IOTiW'></th></span></q></dt></tr></i><div id='IOTiW'><tfoot id='IOTiW'></tfoot><dl id='IOTiW'><fieldset id='IOTiW'></fieldset></dl></div>

                • 本文介绍了jQuery .keypress &amp;.keydown .which的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  好的,.keypress 和 .keydown/.keyup 有什么区别?目前我正在使用 .keydown ,它为我的键返回 38 的 .which 值,现在如果我将其更改为 .keypress 它为同一个键返回 109 的值.有什么区别?为什么同一个键的值不同?

                  Ok so what is the difference in .keypress and .keydown/.keyup? At present I am using .keydown which returns a .which value of 38 for my key, now if i change it to .keypress it returns a value of 109 for that same key. What is the difference and why are the values different for the same key?

                  推荐答案

                  如果你按下一个按钮,它会触发一个 keydown 并释放它会触发一个 keyup.keypress 通常介于这两者之间.

                  If you press a button it fires a keydown and releasing it fires a keyup. The keypress usually comes between those two.

                  keydownkeyup 讨论哪个 key 已更改.keypress 告诉该键代表哪个字符.

                  keydown and keyup talk about which key has been changed. keypress tells which character that key represents.

                  请注意,这完全取决于浏览器!

                  Note that this is all browser-dependent!

                  请参阅这篇文章,了解在不同浏览器上实现的关键事件之间的差异.

                  这篇关于jQuery .keypress &amp;.keydown .which的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:按向上箭头时防止文本输入中的默认行为 下一篇:如何查找特定密钥的密钥代码

                  相关文章

                  最新文章

                  • <bdo id='uoE3p'></bdo><ul id='uoE3p'></ul>
                  1. <small id='uoE3p'></small><noframes id='uoE3p'>

                    1. <tfoot id='uoE3p'></tfoot>
                      <legend id='uoE3p'><style id='uoE3p'><dir id='uoE3p'><q id='uoE3p'></q></dir></style></legend>
                      <i id='uoE3p'><tr id='uoE3p'><dt id='uoE3p'><q id='uoE3p'><span id='uoE3p'><b id='uoE3p'><form id='uoE3p'><ins id='uoE3p'></ins><ul id='uoE3p'></ul><sub id='uoE3p'></sub></form><legend id='uoE3p'></legend><bdo id='uoE3p'><pre id='uoE3p'><center id='uoE3p'></center></pre></bdo></b><th id='uoE3p'></th></span></q></dt></tr></i><div id='uoE3p'><tfoot id='uoE3p'></tfoot><dl id='uoE3p'><fieldset id='uoE3p'></fieldset></dl></div>