我想为Swiper滑块JavaScript库添加一个新的自定义效果.
默认组队,探索影响是slide,fade,cube,coverflow或flip
但我想,以添加所有活动我的自定义效果.我怎样才能做到这一点?
转到s.effects对象(效果部分)swiper.js并添加自己的效果属性,如下所示:
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
}
}
Run Code Online (Sandbox Code Playgroud)要使用新效果,请执行以下操作:
var mySwiper = new Swiper( '.swiper-container', {
// other options …
// and add this
effect: “myEffect”
}
);
Run Code Online (Sandbox Code Playgroud)有关详细信息,请查看此处:https: //github.com/nolimits4web/Swiper/issues/1497
| 归档时间: |
|
| 查看次数: |
1529 次 |
| 最近记录: |