Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1116408

    Cameron
    Participant

    Hi

    I have a revslider carousel setup in X (see details in next post).

    It seems as though the obvious way to navigate between carousels would be to click on a carousel item to bring it into focus.

    However it requires the user to either click the navigation buttons, or to drag the carousel item into focus.

    How can I make a carousel item come into focus (become active) when simply clicked?

    I could probably do this myself with jquery but I don’t see which class(es) need to be actvated — if you could help me with this at least that would be great.

    Thank you

    #1116410

    Cameron
    Participant
    This reply has been marked as private.
    #1116772

    Rad
    Moderator

    Hi there,

    It depends on your slider’s revapi instance. Example, Leadership slider uses revapi4. And you can always find it from your Slider’s API Function setting.

    Please add this code to your slider’s custom javascript.

    jQuery( function($) {
    
    $('#rev-leadership').on('click', function(){
    
    revapi4.revnext();
    
    } );
    
    } );

    Hope this helps.

    #1122784

    Cameron
    Participant

    Thanks for that! So how would I make clicking a specific slide go to that specific slide?

    I guess it’s something like this, but as you can see I’m not quite there:

    
    jQuery(function($) {
     $('#leadershipo-slide').on('click', function() {
      var slide = // not sure how to get data-index="variable" //
       revapi4.revshowslide(slide);  
      });
    });
    #1123419

    Paul R
    Moderator

    Hi,

    You can try this code.

    
    jQuery(function($) {
     $('#leadershipo-slide').on('click', function() {
      var slide = $(this).attr('data-index');
       revapi4.revshowslide(slide);  
      });
    });
    

    Hope that helps

    #1126676

    Cameron
    Participant

    Thanks a lot for your help – it got me to my solution.

    For those looking to do this in future:

    jQuery(function($) {
     $('#SLIDERID li').on('click', function() {
      var slide = $(this).attr('data-index');
      console.log(slide);
      revapi##.revcallslidewithid(slide);
      });
    });

    Where SLIDERID is the ID for your slider (set in Revolution Slider settings)
    And where revapi## is the api number for your slide (viewable in Revolution Slider settings)

    Thanks again

    #1126863

    Rad
    Moderator

    You’re welcome and thanks for sharing the final code 🙂