Search.../

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 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.

Type:

ImageItem

 | 

VideoItem
Read Only

ImageItem

VideoItem

NAME
TYPE
DESCRIPTION
type
string

Item type. Value is "image".

slug
string

Item slug.

src
string

Image source URL.

description
string

Image description. Descriptions over 100 characters are truncated.

title
string

Image title.

link
string

URL of the image's clickable link. See here for more information about links.

Was this helpful?

Get the current gallery item

Copy Code
1let currentItem = $w("#myGallery").currentItem;
2
3/* 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 *