Custom interactions with JavaScript

I’ve been using this great guide https://www.wix.com/code/home/video-custom-interactions?utm_source=blog_launch to create elements that pop-up on hover. I notice the transparent trigger box can be assigned onClick functionality for existing elements on the page, but is there a code to use onClick to load another page on my site? Unfortunately, I can’t use a regular hover box from the interactive menu for this either.

At the moment, instead of adding a standard box I’ve had to add a text box, add a page link to the text inside it and then add onMouseIn/Out to this box to show/hide my hover elements. This does allow the hover effect and page click-through, but it’s a pain aligning the trigger box text with the text box below, plus it seems to glitch when zoomed in at 125% on Chrome. I’d far rather have a transparent trigger box on top that links to other pages.

Hope this is clear as I’m new to coding of any sort. Fingers crossed for a ‘yes’ to the code or perhaps a decent workaround…

hi thewebeditor,
not sure I completely follow, but take a look at this: wix-location-frontend - Velo API Reference - Wix.com

it allows you to navigate to any URL inside or outside your site.

hope it helps.

Hi Ziv,

Thanks for your answer and your patience. I’m sure it would help if I was trained to code, but try as I might it’s as clear as mud to me right now. I can’t work out if/how the to() function can be used with onClick or what keyboard shortcuts bring up the relevant navigation function menus (like ‘Ctrl+space’ and ‘.’ as shown for MouseIn/Out in the tutorial above).

It comes down this. I have a box. I want to click it to take me to another local page. Is it possible? Is there a relevant idiot-proof tutorial that might help?

Thanks again.