I want to add a new custom effect to the Swiper slider JavaScript library.
The default Swiper effects are slide
, fade
, cube
, coverflow
or flip
but I want to add my custom effect with and all events. How can I do that?
I want to add a new custom effect to the Swiper slider JavaScript library.
The default Swiper effects are slide
, fade
, cube
, coverflow
or flip
but I want to add my custom effect with and all events. How can I do that?
1 Answer
Reset to default 6Go to the
s.effects
object (Effects part) inswiper.js
and add your own effect property like this:myEffect: { setTranslate: function() { // your actual animation code goes here }, setTransition: function( duration ) { // duration is between 0 and max speed (300 is default) // but you can change it in the config object below // is called when your swiping starts and ends } }
To use your new effect do this:
var mySwiper = new Swiper( '.swiper-container', { // other options … // and add this effect: “myEffect” } );
For more information have a look here: https://github./nolimits4web/Swiper/issues/1497
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742404815a4437632.html
评论列表(0条)