Swiper API doc out of date?


#1

Does the F7 swiper support the same API as Swiper?

I created using F7 like this:
var mySwiper = myApp.swiper(’.swiper-container’, {
on: {
init: function () {
console.log(‘swiper initialized’);
},
}
});

The init event does not seem to be firing.

I’m setting up the events based on F7 swiper doc which links to the Swiper API doc.

Swiper API Events section says
Swiper comes with a bunch of useful events you can listen. Events can be assigned in two ways:

  1. Using on parameter on swiper initialization:

var mySwiper = new Swiper(’.swiper-container’, {
// …
on: {
init: function () {
console.log(‘swiper initialized’);
},
},
};

method 1 not working as above

  1. Using on method after swiper initialization.

var mySwiper = new Swiper(’.swiper-container’, {
// …
};
mySwiper.on(‘slideChange’, function () {
console.log(‘slide changed’);
});

this is also not working for me using the F7 swiper.

In other posts I found onSlideChangeStart and onSlideChangeEnd events being used. These are not listed as events in the Swiper API doc but they work.

But, both onSlideChangeStart and onSlideChangeEnd are giving me the same activeIndex, which is the slide after the change. How do I get the index of the slide that is about to change, ie before it has changed?

Is there a link with the correct list of events, and maybe any other index properties?


#2

No, v1 of Framework7 has v3 version of Swiper, you can check it’s api at https://github.com/nolimits4web/Swiper/blob/Swiper3/API.md