Hi guys, the title says it all! My site has a store page, which once navigated to generates a lightbox, which explains that all items are currently on hold due to Covid-19. When the lighbox closes, it scrolls to the top of the background page - however, I would like it to scroll to #anchor1, which is located between the page banner and the product list on the background page. How can I achieve this with code? This is the only page that a lightbox appears on.
The page is here: notenoughknife.com/store
Thanks in advance,
Matt
Have not tested this, but I expect it to work something like this:
import wixWindow from 'wix-window'; import wixLocation from 'wix-location'; // ... wixWindow.openLightbox("LightboxName") .then( (data) => { // Lightbox closed: // let receivedData = data; OPTIONAL // scroll to your element of choice $w("#myElement").scrollTo(); } );
Scroll-to
https://www.wix.com/velo/reference/wix-window/scrollto
Open Lightbox
https://www.wix.com/velo/reference/wix-window/openlightbox
wix-location
https://www.wix.com/velo/reference/wix-location