开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜