top of page
Anchor 1

Wix Tutorial - Adding an URL to a Lightbox using Wix Code

Sometimes it can be handy to have a lightbox have a URL. For instance, in case you send out emails with a link in your signature to a video on your site. You can add the video to a lightbox and only have it show when someone clicks the link to it in your email signature.


Lightbox name: urlExample

Wix Code:

import wixWindow from 'wix-window';
import wixLocation from 'wix-location';
function open_Lightbox(){
let query = wixLocation.query;
var goto =;
$w.onReady(function () {

The lightbox then will have the following URL:

Once the code is on a page you can use the URL with any lightbox. If you would like the lightbox to appear when opening another page (not your home page), make sure you add the code to that page and use the following URL:


On this page, Wix Code has been used to show a Lightbox named urlExample.


The above code was used:

Example Wix Code Lightbox with URL

To open the lightbox, click the following URL:

bottom of page