简体   繁体   中英

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 (eg, $('a.next).click(...[trigger]...)) ? How can I call the trigger?

Thank you very much for your help.

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');
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM