开发者

Navigate the images with the arrow keys on the keyboard with jquery [closed]

开发者 https://www.devze.com 2023-02-11 10:13 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

开发者_JAVA百科I have a div divided into two lines, built dynamically, that I have a query that returns me the images if they are over 13 becomes the span of two righe.E 'can be an example to browse these images with the arrow keys on the keyboard, going in any direction with jquery?


Your question is a little unclear - you may want to edit it :)

To navigate with the arrow keys you can add a keydown event listener to the document:

$(document).bind('keydown.gallery', function(e) {
    if (e.keyCode == 37) {
            e.preventDefault();
            // Do left arrow stuff
    } else if (e.keyCode == 39) {
            e.preventDefault();
            // Do right arrow stuff
    }
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号