Question

I have two slides and they move fine from first to second. But the problem is my chief doesn't want it move on - from second to the first back. I looked for this option in Jssor API but didn't find anything. Here is my code:

slider.$On($JssorSlider$.$EVT_PARK, $.proxy(function(slideIndex, fromIndex) {
    Session.recordTime("Section " + section + ", slide " + (slideIndex + 1));
    $("#pager").text((slideIndex + 1) + "/" + $("#content").find(".slide").length);
}));

I'll be very appriciated for any help. Victor

Was it helpful?

Solution

You can set the '$Loop' option value to false to stop the slider from looping infinitely.

Use following code to stop the slider at slide 2,

slider.$On($JssorSlider$.$EVT_PARK, $.proxy(function(slideIndex, fromIndex) {
    if(slideIndex == 1)
    {
        slider.$Pause();
    }
}));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top