Skip to content

Switch Event ​

Relevant Configuration Options ​

PropertyDescriptionTypeDefault
changeFnCallback function for switching imagesFunction—

changeFn ​

The changeFn option accepts a callback function that is triggered when the plugin switches images. The returned argument is params.

params ​

keyDescriptionNotes
typeDirectionprev: previous image
next: next image
thumb: thumbnail was clicked
fromImgIndexCurrent image index
fromImgUrlCurrent image URL
toImgIndexTarget image index
toImgUrlTarget image URL
wayTrigger methodcontrol-bar: control bar
key-a: key a
key-d: key d
key-left: arrow ←
key-right: arrow →
arrow-btn: arrow button
thumb: thumbnail