hello friends,
I’m having an issue with a button with delayed display, I tried to use the SETTIMEOUT and DELAY function but I couldn’t get it to work well, and they never work.
I finally tried to create a Lightbox with a button included and a timer,
but I know that Lightbox needs a Trigger and so I would like this trigger to be the Play button in wix video. (this is a 30min sales page)
how would you go about solving this issue?
how to make this thing work?
import { local } from ‘wix-storage’ ;
import wixWindow from ‘wix-window’ ;
$w . onReady ( function () { if (! local . getItem ( “firtTimePopupShown” )) {
setTimeout ( function () => { wixWindow . openLightbox ( “np” )}, 240000 );
local . setItem ( “firstTimePopupShown” ), “yes” );
}
}
export function videoPlayer1_play ( event ) { if $w ( ‘#videoPlayer1’ ) ( params ) {
So just to clarify for setTimeOut. This function waits a predefined amount of time and then runs the function you specified. So your code is currently saying set a time out for 240,000 ms (ie. 4 minutes) and then open this Lightbox named “np”. If this is what you want then it should work.