Documentation for swiper plugin API #4635
linonetwo
started this conversation in
Show and tell
Replies: 1 comment
-
I was trying to solve #1928 , and I'm done now, proving that a plugin can do many things. Related threads #4632 #4644 #4646 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, https://swiperjs.com/swiper-api page seems all about config parameters for swiper instance and what method you can call from an swiper instance, but it is actually also about swiper plugin API.
method
For example:
means you can write
setTransition
as a method in your plugin:And this method receive
swiper
asthis
, andtransition
as first argument.swiper instance
method of your plugin will be called after swiper instanced, so you can get all things listed in https://swiperjs.com/swiper-api#methods-and-properties
But there can also be something not documented, like
slidesSizesGrid
, I don't know what it is...And get your plugin's param from
swiper.params.coverflowEffect
just like in the effect-coverflow example js.To make changes to the swiper dom elements, basically, you will need to get element via
plugin provided methods
You can provide some methods for an end-user to use, for example, you want to add
swiper.autoplay.start()
:other
I'm just starting reading code, so this is a WIP.
Beta Was this translation helpful? Give feedback.
All reactions