I have a repeater that has the following code that allows a container item to be clicked on open a URL. This all works well except a few of my container items don’t have a URL, and so the cursor needs to remain as a pointer (eg not clickable).
Any idea how to do this?
//PKB need for OnClick Event
import wixLocation from ‘wix-location’;
$w.onReady(function () {
// Write your Javascript code here using the Velo framework API
//PKB used in containers onclick event
$w('#section2rep1container1').onClick((event) => {
let $item = $w.at(event.context);
let clickedItemData = $item("#dataset1").getCurrentItem();
let itemURL = clickedItemData.imageUrl;
if (itemURL) {
wixLocation.to(itemURL);
} else {
console.log("no cursor here");
}
})
});
$w(‘#instagramFeed1’).onWidgetLoaded((event) => {
})