Hello,
Try writing it like this:
$w("#myElement").onMouseIn( (event, $w) => {
wixWindow.openLightbox("lightbox1");
} );
Let me know if this works,
Majd
EDIT:
On second thought if you are going with that technique it is better to be on view port entered like seen in the documentation here, in any case I would try both: