navigateByClick: previous/next slide based on cursor position

matias.kukka's Avatar

matias.kukka

03 Mar, 2015 11:54 AM

Is it possible to set navigation by clicking as follows: If the click happens on the left side of the slide, the slider goes one step back and by clicking on the right side of the slide the slider proceeds to the next slide? Could not find this option in documents or on this forum. Thanks in advance!

  1. Support Staff 1 Posted by Dmitry Semenov on 03 Mar, 2015 02:27 PM

    Dmitry Semenov's Avatar

    Hi,

    You may disable navigateByClick and implement your own navigation via API:

    $('.royalSlider').data('royalSlider').ev.on('rsSlideClick', function(e, origEvent) {
       console.log(origEvent.offsetX);
    });
    

    Check for offset in this handler and based on it either call $('.royalSlider').data('royalSlider').next() or prev() methods.

  2. matias.kukka closed this discussion on 04 Mar, 2015 06:57 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