The events are for a gallery component
The mouseOut and mouseIn events fire properly. The dblClick and itemClicked do not.
The itemClicked event does work if registered in the onReady function, but it fires when the page loads and throws an error in the console “Cannot read property ‘itemIndex’ of undefined”. The event should not fire on the page load.
Here is the code:
// For full API documentation, including code examples, visit Velo API Reference - Wix.com
import wixWindow from ‘wix-window’;
$w.onReady( function () {
$w(“#gallery1”).onItemClicked( (event, $w) => {
//let itemDescription = event.item.description; // “Description”
let itemIndex = event.itemIndex; // 3
console.log("Item Clicked: " + itemIndex)
});
} );
export function gallery1_mouseIn(event, $w) {
//Add your code for this event here:
console.log(“mouseIn—mouseIn—mouseIn—mouseIn—mouseIn”);
}
export function gallery1_itemClicked(event, $w) {
//Add your code for this event here:
console.log(“itemClicked—itemClicked—itemClicked—itemClicked—itemClicked”);
}
export function gallery1_dblClick(event, $w) {
//Add your code for this event here:
console.log(“dbClick—dbClick—dbClick—dbClick—dbClick”);
}
export function gallery1_mouseOut(event, $w) {
//Add your code for this event here:
console.log(“mouseOut—mouseOut—mouseOut—mouseOut—mouseOut”);
}