BxSlider—Click Slide for Next

3k views Asked by At

Instead of using prev/next controls, I'd like to turn the slide itself into a next button. Pretty straightforward functionality, but I can't seem to figure it out.

This is what I have:

$(document).ready(function() {
  $('.bxslider').bxSlider({
    adaptiveHeight: true,
    easing: 'cubic-bezier(0.600, 0.060, 0.500, 1)'
  });
  $('.bxslider').click(function() {
    slider.goToNextSlide();
    return false;
  });
});
1

There are 1 answers

0
Dhiraj On BEST ANSWER

Firstly, create an instance of the slider like this

var slider = $('.bxslider').... and then attach the onClick to the same input.

Something like this should work.

var slider = $('.bxslider').bxSlider({
    adaptiveHeight: true,
    easing: 'cubic-bezier(0.600, 0.060, 0.500, 1)'
}).on('click', function(){
    slider.goToNextSlide();
});