Clickable container link for Desktop, Mobile and Tablet

I have the below code which is working for desktop when clicking conatiner taking me to project.

import wixLocation from ‘wix-location’;

$w.onReady(function () {
$w(“#box41”).onClick(() => {
wixLocation.to(“https://synergycreative.wixstudio.com/synergy2025lpalt/conti-ultracontact-ux7”);
});

Can anyone help with how I can have this also working for mobile and tablet? Assume it needs to say something otehr than ‘onclick’

Thanks in advance.

the onClick should work for all breakpoints.

maybe the clickable element is behind another element on the other breakpoints ?

Thanks for the response, all appears to be OK across all breakpoints.

Can you see any issues in the below screengrabs? I’ve highlighted corresponding code.


And just to add to this, Link is working on my google chrome browser but not safari (for mobile).

ahhh…Safari…the browser that should have been killed off years ago.

not sure what can be adjusted for this

1 Like

The hacky soulution would be to put transparent buttons that fully cover the area you want to be clickable.

That being said, I’ve done onClick that worked in Safari before, so not sure if that’s the problem. I see in your code that you’ve got red underlines for code errors. You’re also using the $w.onReady slightly wrong. You should only call it once on the page, and have all the code that you want to run inside a single one instead of using on for each onClick.

1 Like

Thanks for the replies, must have been an issue with my coding. This has now been resolved.