Switch Event
Relevant Configuration Options
Property | Description | Type | Default |
---|---|---|---|
changeFn | Callback function for switching images | Function | — |
changeFn
The changeFn
option accepts a callback function that is triggered when the plugin switches images. The returned argument is params
.
params
key | Description | Notes |
---|---|---|
type | Direction | prev : previous imagenext : next imagethumb : thumbnail was clicked |
fromImgIndex | Current image index | |
fromImgUrl | Current image URL | |
toImgIndex | Target image index | |
toImgUrl | Target image URL | |
way | Trigger method | control-bar : control barkey-a : key a key-d : key d key-left : arrow ← key-right : arrow → arrow-btn : arrow buttonthumb : thumbnail |