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

      <bdo id='6Smdg'></bdo><ul id='6Smdg'></ul>

      <small id='6Smdg'></small><noframes id='6Smdg'>

      1. <legend id='6Smdg'><style id='6Smdg'><dir id='6Smdg'><q id='6Smdg'></q></dir></style></legend>

        jQuery 按键左/右导航

        时间:2023-09-07
        <i id='FhwDi'><tr id='FhwDi'><dt id='FhwDi'><q id='FhwDi'><span id='FhwDi'><b id='FhwDi'><form id='FhwDi'><ins id='FhwDi'></ins><ul id='FhwDi'></ul><sub id='FhwDi'></sub></form><legend id='FhwDi'></legend><bdo id='FhwDi'><pre id='FhwDi'><center id='FhwDi'></center></pre></bdo></b><th id='FhwDi'></th></span></q></dt></tr></i><div id='FhwDi'><tfoot id='FhwDi'></tfoot><dl id='FhwDi'><fieldset id='FhwDi'></fieldset></dl></div>
      2. <tfoot id='FhwDi'></tfoot>

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

                <bdo id='FhwDi'></bdo><ul id='FhwDi'></ul>

              • <legend id='FhwDi'><style id='FhwDi'><dir id='FhwDi'><q id='FhwDi'></q></dir></style></legend>
                  <tbody id='FhwDi'></tbody>

                  本文介绍了jQuery 按键左/右导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我想让我的内容滑块能够响应按键(左箭头键和右箭头键)功能.我读过一些浏览器和操作系统之间的一些冲突.

                  I want to give my content slider the ability to respond to keypress (LEFT ARROW key and RIGHT ARROW key) feature. I have read about some conflicts between several browsers and operation systems.

                  用户可以在全球网站(正文)上浏览内容.

                  The user can navigate the content while he is on the global website (body).

                  伪代码:

                  ON Global Document
                  
                  IF Key Press LEFT ARROW
                  
                  THEN animate #showroom css 'left' -980px
                  
                  
                  IF Key Press RIGHT ARROW
                  
                  THEN animate #showroom css 'left' +980px
                  

                  我需要一个没有任何交叉(浏览器、操作系统)冲突的解决方案.

                  I need a solution without any crossover (Browsers, OSs) conflicts.

                  推荐答案

                  $("body").keydown(function(e) {
                    if(e.keyCode == 37) { // left
                      $("#showroom").animate({
                        left: "-=980"
                      });
                    }
                    else if(e.keyCode == 39) { // right
                      $("#showroom").animate({
                        left: "+=980"
                      });
                    }
                  });
                  

                  这篇关于jQuery 按键左/右导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何在不接受焦点的元素上获取键盘事件? 下一篇:如何在 Chrome 和 IE 中跟踪箭头键?

                  相关文章

                  最新文章

                • <tfoot id='RcD1s'></tfoot>

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

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

                      <legend id='RcD1s'><style id='RcD1s'><dir id='RcD1s'><q id='RcD1s'></q></dir></style></legend>