Simple openLightbox doesn't work

@contact13073

Ok, do the following steps:
-check the name of your Lightbox —> Lightbox1 that is correct?
-delete your anchor and add a new one → give it the following ID → anchor1
-do NOT connect the anchor with the code (already done in the code)!
-put in the following code into the CODE-section of your choosen page
-check one more time the position of your anchor (does it leave and enters the viewport, when do some scrolling)?

After everything is checked, test the action in LIVE-MODE.

import wixWindow from 'wix-window';

$w.onReady(function () { 
    $w('#anchor1').onViewportEnter(()=>{
        wixWindow.openLightbox("Lightbox1");
        console.log("Vieport entered")
    }) 
});

Take a look into console (as already mentioned by Er.Muthu).
Press F-12 on your Keyboard (if using google-chrome) and go to the CONSOLE.
While doing some action on the site, take carefully a look onto the output of CONSOLE. You should see —> “Viewport entered”

If not something is setted wrong.