I have got a site made with wix and I found this code that allows you for a custom preloader screen. It works fine, however it keeps triggering whenever the site is refreshed or you press the back button. Can I make it trigger only once every 10 minutes or once per session? If you have an idea on how to do it would you be kind enough to post your solution? I studied JS but it was long ago and in the end I gave up. Cheers!
$w.onReady(() => {
waitForLoading();
});
export function button6_onClick() {
$w('#lightbox1').show();
waitForLoading();
}
function waitForLoading() {
setTimeout(() => {
$w('#lightbox1').hide('FadeOut');
}, 1500);
}