I have a store page on my site which features a lightbox upon loading, informing people that all store products are on hold due to COVID-19. Once dismissed, the page scrolls down to an anchor… at least, it does on my site preview. The live site doesn’t work, and it makes no sense to me.
Here’s the code (which was provided by one of you lovely people):
import wixWindow from 'wix-window';
import wixLocation from 'wix-location';
// ...
wixWindow.openLightbox("Covid-19")
.then( (data) => {
// Lightbox closed:
// let receivedData = data; OPTIONAL
// scroll to your element of choice
$w("#anchor1").scrollTo();
});
‘box2’ is invisible, but is completely separate to the lightbox issue. ‘box2’ controls the fading of a navigation arrow, which works perfectly. Regardless, I have provided an image.
@wfsenior It’s editorX, isn’t it? It looks like this element doesn’t exist on all breakpoints only on some of them.
I don’t know if that’s the issue you were talking about, but first you should fix it and see if it solved the issue.
Second, you wrote: “The live site doesn’t work” but you didn’t explain what didn’t work. The lightbox? The scroll? Something else?
@jonatandor35 This isn’t editorX, but I do anticipate the day when we original users can migrate to the new system (although I won’t hold my breath!)
To clarify, the issue lies in the scrolling. In the preview, once I close the lightbox, it scrolls to Anchor#1 (which is below the first strip). This is exactly how it should work, and how it was coded. However, on the live site, once the lightbox is closed, it takes the user to the top of the page.
@jonatandor35 That’s actually really helpful, thankyou. It’s really strange. When I load up preview mode from the store page, there is no error. But when I load up preview mode on a different page, then navigate to the store page, the error appears. I can’t put my finger on it.