Daniel Broger
Daniel Broger

Reputation: 27

Custom Link Trigger for Previous/Next Slide in Basic jQuery Slider

I am working on a slider project based on the Basic jQuery Slider (http://www.basic-slider.com) creatd by John Cobb (https://github.com/jcobb/basic-jquery-slider).

The problem: Given my project specs, instead of using the default controls, I need to add a link below the current slide that shows the title of the next slide and when that link is clicked the slider goes to the that slide.

My question: Is there a way to trigger the move to the next slide using a simple jQuery click event (e.g., $('a.next).click(...[trigger]...)) ? How can I call the trigger?

Thank you very much for your help.

Upvotes: 1

Views: 1135

Answers (1)

Ryan
Ryan

Reputation: 1338

If you set the default controls to hidden, either by setting the opacity or display none, you should be able to use this code:

$('a.next').click(function() {
    $('.bjqs-next a').trigger('click');
});

$('a.prev').click(function() {
    $('.bjqs-prev a').trigger('click');
});

Upvotes: 1

Related Questions