Dear ladies and gentlemen,
during the development of our website, we encountered a problem. We have integrated several lightboxes, and since we work with data and transfer it from one lightbox to another, we decided to work with the getContext() function and configure the functionality of the buttons to our own methods. Unfortunately, this caused a problem, and sometimes the functionality of the buttons is not recognized at all (the function does not work when the button is pressed), and the buttons are completely useless. We hope you can help us.
Can you please post some code so we can see what you are doing?
export async function btnOpenLightbox_click(event) { // The button works
wixWindow.openLightbox(“lightbox 1”, {});
}
lightbox 1
export async function btnOpen_click(event) { // The button works
$w(‘#preloader’).show();
wixWindow.openLightbox(“lightbox 2”, {data: []});
}
export async function btnTest1_click(event) { // The button works
$w(‘#preloader’).show();
console.log(“Test1 click”)
$w(‘#preloader’).hide();
}
export async function btnTest2_click(event) { // The button works
$w(‘#preloader’).show();
console.log(“Test2 click”)
$w(‘#preloader’).hide();
}
lightbox 2
export function btnBack_click(event) { // The button works
$w(‘#preloader’).show();
wixWindow.openLightbox(“lightbox 1”, {});
}
export async function btnTest3_click(event) { // The button doesn’t work
$w(‘#preloader’).show();
console.log(“Test3 click”)
$w(‘#preloader’).hide();
}
export async function btnTest4_click(event) { // The button doesn’t work
$w(‘#preloader’).show();
console.log(“Test4 click”)
$w(‘#preloader’).hide();
}
If you remove the Back button, the btnTest3 button starts working, but the btnTest4 button still does not