How to avoid the home page to reload or reorder swiper slides when going back?

Is there a way to avoid the home page to reload elements when going back?

I have at my home page html two swiper sliders, I open a new page when I double tap on a slide using this code:

var swiper = app.swiper.create('.swiper-container.all-stores', {


                    on: {
                      doubleTap: function (e) {

                        var $ = this.$;
                        var id = $(e.target).attr('data-id');                        

                        setTimeout(function(){
                          app.views.main.router.navigate('/store/'+id+'/');
                        }, 500);

                      },                    
                    }

when coming back from that page opened after click, the slides return to the position where there were when I entered the home page all the time, they do not remain where I slide to…

How to avoid this repositioning or refresh of swiper slides when returning back from another page to the home?

I still trying to find a solution but I do not find an easy way to avoid this behaviour I do appreciate any tips!

thanks

how do you init the swiper? pageInit? pageBeforeIn?
also, you could store the current index in a var and then, on pageBeforeIn, or whatever you think its useful, set the swiper to that index

inside pageinit the problem all swipers lies move to first slide after I return from another page to the home page where all slides are…

any quick solution?
appreciate your tips!

This is a quick solution

1 Like

big thanks I think I will try this out! :slight_smile: