top of page
Crumpled Fabric

2

Quick View with Wix Lightbox

Click URL to copy

Mar 4, 2023

2 min read

WIX Ideas

Tags: Lightbox Wix Window Velo by WIX

Introduction


๐ŸŽฌ Welcome to Wix Ideas' Quick View with Wix Lightbox! ๐ŸŽฅ


Get ready to take your website to the next level with this amazing feature.


๐Ÿš€ In this video, I'll show you how to use the Wix Lightbox to create a quick view for your Wix website. Say you do not want to redirect your site visitors to a dynamic page, but instead, you want them to have a quick overview of the item, then this feature will be very useful.


๐Ÿ’ป Whether you're a blogger, photographer, or e-commerce owner, this tool is perfect for showcasing your products, images, and videos in a stunning way.


You'll learn how to easily add images and other Wix elements to your lightbox, customize its layout, use Wix Velo code to send data from a repeater on your page to your lightbox, and create a seamless user experience for your website visitors.


๐Ÿคฉ Plus, we'll give you some tips and tricks on how to optimize your lightbox for maximum engagement and conversions. ๐Ÿ“ˆ So grab a cup of โ˜•๏ธ and join us for this exciting tutorial! Don't forget to like and subscribe for more awesome content.


๐Ÿ”” Let's get started! ๐ŸŽ‰


Steps

  1. Add a lightbox to your site

  2. Add elements you wish to display

  3. Connect the elements to your dataset


Add Lightbox To Wix Site
Add Lightbox To Wix Site

The Code


Step 1: Import wix window.

The wix-window module contains functionality that pertains to the current browser window.
import wixWindow from 'wix-window';

Step 2: Add a page code to your repeater to get the ID of the item and send it to your lightbox

$w.onReady(function () {

    $w("#repeater9").onItemReady(($w, data) => {

        $w("#triggerButton").onClick(() => {

            wixWindow.openLightbox("lightboxName", data._id)

        });

    });

});

Step 3: Import wix window and wix data on your lightbox to receive data from the repeater on your page

import wixWindow from 'wix-window';
import wixData from 'wix-data';

Step 4: Use the lightbox getContext() function to receive the data(ID) and use it to filter the dataset using the dataset's setFilter() function.


$w.onReady(function () {

    let dataID = wixWindow.lightbox.getContext();

    console.log(dataID)

    $w("#dataset1").setFilter(wixData.filter().eq("_id", dataID));

});

That's it!

Code



Leave a comment (0)

Thanks for leaving a comment๐ŸŽ‰

kaan

kaan

Jun 4, 2023

wishlist and rating system

hello sir I try today 2 hours but not working if you want I pay money can you do this 2 ( wishlist and rating star) system please I send to you invaid

Reply

Admin

Waqas

Waqas

Apr 16, 2023

Triggered Email Backend

Hi mate please can you send email by backend

Reply

Walter Odibi

Walter Odibi

Admin

Hi Waqas, there isn't a backend code for this tutorial. The emails will be sent from the client-side.

Ghan

Ghan

Dec 29, 2022

Great Tutorial

Hi !

First of all, I want to thank you for your great tutorials, they helped us a lot with the coding.
But I still need your help, if you don't mind. I have based on Save Calculated Field using Wix Data Hooks Codes, to code my form . but the problem is I don't know why the code only reads the computation for "week2" computation and not the "weeks"

here is the code

I also did a separate column in the dataset where the chosen datas for both fields will be placed.

$w.onReady (() => {
$w("#Person").onChange(() => {
$w("#weeks").onChange(() => {
$w("#week2").onChange(() => {
let person = Number($w("#Person").value);
let weeks = Number($w("#weeks").value);
let week2 = Number($w("#week2").value);


$w("#totalLabel").show();

$w("#totalLabel").text = `"${String(weeks * Number(person))}ํŽ˜์†Œ"`; //DESIGN YOUR MESSAGE
$w("#totalLabel").text = `"${String(week2 * Number(person))}ํŽ˜์†Œ"`; //DESIGN YOUR MESSAGE

});
});
});

});

Reply

Walter Odibi

Walter Odibi

Admin

Hi there, thanks for your comment. I see why this is a problem. The onChange() function seems wrong in combination.

To combine onChangeFunctions use this method

$w("#Person, #weeks, #weeks2").onChange(() => {

//code here

});

Walter

Walter

Aug 8, 2022

More Details? Watch video

Hi, you can click here to watch the video https://www.youtube.com/watch?v=9bx7-nBeZ5c

Reply

Walter Odibi

Walter Odibi

Admin

Walter

Walter

Jul 11, 2022

For you

Reply

Walter Odibi

Walter Odibi

Admin

Walter Odibi

Walter Odibi

Apr 18, 2022

Awesome Feature

This tutorial shows you how to display views on your Wix repeater.

๐Ÿ“บWATCH VIDEO HERE https://www.youtube.com/watch?v=Iz7SdaCSdXg

Reply

Walter Odibi

Walter Odibi

Admin

Walter Odibi

Walter Odibi

Apr 18, 2022

Amazing tutorial

This amazing tutorial will show you how to a comment section to your WIX dynamic page.

๐Ÿ“บWATCH VIDEO HERE https://www.youtube.com/watch?v=f8-vJQFNZ_c

Reply

Walter Odibi

Walter Odibi

Admin

Walter Odibi

Walter Odibi

Apr 10, 2022

Great Feature๐ŸŽ‰

This amazing tutorial will show you how to add a visitor view counter to your WIX dynamic page.

๐ŸšฉMORE TUTORIALS https://www.wixgenius.com/wix-tutorials

Reply

Walter Odibi

Walter Odibi

Admin

RELATED TUTORIALS ๐Ÿš€

Selectable Wix Buttons

Selectable Wix Buttons

Add Selectable Wix Buttons to your Wix website using Wix buttons and velo.

bottom of page