Hi Cracks
I have used coding from other examples from Forum.
Partially, it works, but not the way, as it should work.
PROBLEMS
- Lightbox-Cookies always pop up, whenever I come back to page, where the code is embedded
- Lightbox-Cookies does not pop up on other pages of the site, when I land there first.
GOAL
should be that Lightbox will pop up on whichever page somebody lands first, across the whole site.
Any help?
PAGE CODE
import {local} from âwix-storageâ;
import wixWindow from âwix-windowâ;
$w.onReady( function () {
// flag is not found
if (!local.getItem(âfirstTimePopupShownâ)) {
// open popup
wixWindow.openLightbox(âCookiesâ);
}
} );
SITE
import {local} from âwix-storageâ;
import wixWindow from âwix-windowâ;
import wixLocation from âwix-locationâ;
export function AcceptCookies_click(event, $w) {
// set flag for future visits
local.setItem(âfirstTimePopupShownâ, âyesâ);
wixWindow.lightbox.close();
}