user3159221
user3159221

Reputation: 37

Swiper API Jquery

Hi guys I am a newbie in jquery especially when I have to work third party plugins

So I have been working with one here http://www.idangero.us/sliders/swiper/api.php

in one of my slides, I have a form where user submits and returns a result (php)

however it goes back to first slide after refresh, I need to direct it to last slide enabling my user to see their result. Is this possible?

This is what I have so far

<script>
window.onload = function(){
var mySwiper = new Swiper('.swiper-container',{


   }
 });  
};

 </script> 

Upvotes: 1

Views: 2531

Answers (1)

chaenu
chaenu

Reputation: 2025

Do you know the index number of the last slide? You can set the starting slide with the option initialSlide (it's mentioned in the docs).

var mySwiper = new Swiper('.swiper-container',{
  initialSlide: 2 // set "2" to the index of the last slide
});  

Otherwise you could get the active index with mySwiper.activeIndex before submitting the form.

Upvotes: 1

Related Questions