Onclick to Webpage/site

This seems like it should be simple but I can’t seem to get this to work. I just want this to go out to a specific webpage when clicked?

export function hoverBox1_click(event) {
//Add your code for this event here:
}

Any help is greatly appreciated

At the top of your code put this line
import wixLocation from ‘wix-location’;

export function hoverBox1_click(event) {
wixLocation.to(“http://www.mydestination.com”);
}

and if it’s an internal page inside your Wix site, than you can do it like that:
import wixLocation from ‘wix-location’;

export function hoverBox1_click(event) {
wixLocation.to(“/home”);
}

1 Like