How to change image hyperlink .clickAction

I have a site where I have several image boxes, each has a link to another page. I want to programmatically disable the link sometimes and re-enable it at a later point based on information in a database. I can’t seem to figure out how to disable or modify the link.

I tried:
$w ( ‘#imageboxname’ ). clickAction = “none”

but it did not disable the click, it still opened to the link.

But when I did
$w(‘#imageboxname’).clickAction = “magnified” works just fine!,

Can anyone help me out ?

i don’t know what Image Box.
But if you’re talking about an image with link just remove the link and restore the link when ever you need.

const link = '';
$w.onReady(() => {
$w('#image1').link = '';
$w('#button1').onClick(() => $w('#image1').link = link);
1 Like

Hi JD, yes image with link, sorry I used the wrong terminology. What you suggested works great. Thanks!

1 Like