Change keyboard navigation keys

yyyannick2's Avatar

yyyannick2

23 Aug, 2012 05:13 PM

Hi, i would like to know if there's a way of changing the keyboard arrow control, instead of using left and right keys i would like to use up and down keys...im using the vertical slider.

I would appreciate any help, thanks :)

  1. Support Staff 1 Posted by Dmitry Semenov on 24 Aug, 2012 07:05 AM

    Dmitry Semenov's Avatar

    Hi,

    In document ready, after slider is initialized:

    // get instance of slider
    var slider = $('.royalSlider').data('royalSlider');
    // unbind old event and add new
    $(document).off('keydown.rskb').on('keyup.rskb', function(e) {
        if (e.keyCode === 38) {
            e.preventDefault();
            slider.prev();
        } else if (e.keyCode === 40) {
            e.preventDefault();
            slider.next();
        }
    });
    

    Dmitry

  2. Dmitry Semenov closed this discussion on 26 Aug, 2012 05:19 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac