Adds an event handler that runs when a gallery's current item changes.
A gallery's current item changes through playing or certain user interactions.
Notes:
The onCurrentItemChanged()
function is supported by galleries where
the hasCurrentItem
capability is true
.
If you change the gallery's type
to one that doesn't support hasCurrentItem
and you try to use it, your
code may no longer function correctly.
handler(event: GalleryItemChangedEvent): void
The name of the
function or the function expression to run when the gallery's current
item changes.
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.