Add link to the right button when it reach the last slid

jinkinz's Avatar

jinkinz

04 Dec, 2012 06:45 AM

hi i would like to add a link to the right button
when it reaches last slide,
may i know is that possible?

how could i detect it come to the last slide?

  1. Support Staff 1 Posted by Dmytro Semenov on 04 Dec, 2012 07:41 AM

    Dmytro Semenov's Avatar

    HI,

    Use slider API to do this, all I can help:

    var slider = jQuery('.royalSlider').data('royalSlider');
    slider.ev.on('rsBeforeAnimStart', function() {
        console.log(slider.numSlides, slider.currSlideId);
    });
    

    Dmitry

  2. 2 Posted by jinkinz on 04 Dec, 2012 03:22 PM

    jinkinz's Avatar

    is there any function call 'rsAfterAnimEnd' ??

  3. Support Staff 3 Posted by Dmytro Semenov on 04 Dec, 2012 07:34 PM

    Dmytro Semenov's Avatar
  4. 4 Posted by jinkinz on 04 Dec, 2012 07:50 PM

    jinkinz's Avatar
    if(slider.currSlideId == (slider.numSlides-1))
        {
            $('.rsArrowRight').click(function(e) {
                console.log(slider.numSlides, slider.currSlideId);
              window.location = "http://google.com";
            });
    }
    

    i tried to put this, but theres a bug,
    it go the link.

    i just want user able to go to google.com when it reaches the last slide , and only the last slide, is that possible?

  5. Support Staff 5 Posted by Dmytro Semenov on 05 Dec, 2012 10:14 PM

    Dmytro Semenov's Avatar
    $('.rsArrowRight').off('click').on('click.custom',function(e) { 
        e.preventDefault(); 
        if($(e.currentTarget).hasClass('rsArrowDisabled')) { 
            console.log('do something'); 
            return false; 
        } else { 
            $('.royalSlider').royalSlider('next'); 
        } 
    });
    

    Dmitry

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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