I have created a user input dropdown with 3 options. Each option should open a lightbox. I have been able to make it work for URL’s but somehow I can’t workout how to get it to work using the wixWindow - Open Lightbox function to get it work.
NOTE: I am very new in coding and using Wix Corvid, so please be patient with me. Thanks, really appreciated.
Below the code I have been able to create and working for the URL dropdown.
import wixLocation from ‘wix-location’;
import wixWindow from ‘wix-window’;
$w.onReady( function () {
$w(“#dropdown1”).options = [
{“label”: “Variety 1”, “value”: “https://www.google.com”}, // Variety 1 Lightbox
{“label”: “Variety 2”, “value”: “https://www.google.com”}, // Variety 2 Lightbox
{“label”: “Variety 3”, “value”: “https://www.google.com”} //Variety 3 Lightbox
];
});
export function dropdown1_change_1(event) {
//Add your code for this event here:
let gotoPage = $w(“#dropdown1”).value;
wixLocation.to(gotoPage);
}
What I want to achieve now is, to change the URLs with Variety 1, Variety 2, Variety 3 in the dropdown options, and then change the export function “dropdown1_change_1(event)” so the lightboxes Variety 1, Variety 2, and Variety 3 will be loaded on selection.
Is anyone out there who can help me out and show me how to write the correct export function.
Thanks heaps guys and girls.