currentItem
Gets an object containing information about the current item.
Description
The current item object can be either an ImageItem
or a VideoItem
.
About ImageItem
Items
An ImageItem
is an object used by the Gallery properties items
and currentItem
to
represent a single gallery image.
The src
property of a ImageItem
can be:
- An image from the Media Manager.
- An external image from any web location (some galleries do not support external images).
The image source format for Media Manager images is:
wix:image://v1/<uri>/<filename>#originWidth=<width>&originHeight=<height>[&watermark=<watermark_manifest_string>]
About VideoItem
Items
A VideoItem
is an object used by the Gallery properties items
and
currentItem
to represent a single gallery video.
A VideoItem
can be used as an item in a Pro Gallery.
To determine if your gallery is a Pro Gallery or a standard gallery, hover over the gallery while it is not selected. The gallery type appears above the upper left corner of the gallery. If the type is "Wix Pro Gallery", then your gallery is a Pro Gallery. If the type is anything other than "Wix Pro Gallery", your gallery is a standard gallery.
The video source format is:
wix:video://v1/<video_uri>/<filename>#posterUri=<poster_uri>&posterWidth=<width>&posterHeight=<height>
Notes:
The
currentItem
property is supported by galleries where thehasCurrentItem
capability istrue
.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.
Type:
|
VideoItemImageItem
VideoItem
NAME
TYPE
DESCRIPTION
Item type. Value is "image"
.
Item slug.
Image source URL.
Image description. Descriptions over 100 characters are truncated.
Image title.
Was this helpful?
Get the current gallery item
1let currentItem = $w("#myGallery").currentItem;23/* currentItem:4 * {5 * "type":"Image",6 * "title":"A View",7 * "src":"wix:image://v1/99bc1c6f66444769b531221214c885ac.jpeg/A%20View.jpeg#originWidth=3264&originHeight=2448"8 * }9 *