top of page

Utility

Tools

Open a Link When A Container is Clicked

Image Showing How to Use Wix Location API to open a URL

This code open a URL when website visitors clicks a container. This Velo code uses Wix Location API.


Code


import wixLocation from 'wix-location';


$w.onReady(function () {

    // Replace with your container ID

    $w('#container1').onClick(() => {

        // Replace with the link you want to open

        wixLocation.to("https://www.example.com");

    });

});


bottom of page