Ninja Slider / Posts /

How to make the slider stop at the last slide

4
Can anyone tell me how to make the responsive slider stop at the last slide?
Dragen  5 years ago   viewed: 10911    

3 Answers

-1

We can use the build-in before or after event handler and the toggle function to accomplish the task. Suppose you have 4 slides in the slider:

In the nsOptions of the ninja-slider.js, you will find the before variable:

var nsOptions = { ...... before: null, ...... }
You can set it to:
var nsOptions = { ...... before: function (currentIdx, nextIdx, manual) { if (nextIdx == 3) nslider.toggle(); }, ...... }
Note: the index number is zero-based.
Milo   5 years ago
0
this will make the slide stop, but how to continue from slide 0 while reaching the last slide; instead of showing all slides navigation to reach at slide 0. (in simple can the slider continues slides from slide 0 when it reach last slide instead of showing the whole slides in reverse mode?)
Shahid
  5 years ago
2
Set {rewind: false, ...} in ninja-slider.js nsOptions.
Milo   5 years ago

   

Your name*
Password
(Optional. Used to modify this post afterwords)
+ =  

Ask your Own Question

  • If your question is related to the topic of this post, you can post your question to this page by clicking the "Post a reply" button at left;

  • When you want to start a new page for your question: