I have a link (text37) that I would like perform a sequence within my Wix site:
I need it to:
1. make an embedded video appear (expand)
2. play the video, and when the video is over,
3. go to an anchor on another page of the same site.
So far I can do the first two with this code:
export function text37_click (event) {
$w("#videoPlayer1").expand(),$w("#videoPlayer1").play(), $w("#videoPlayer1").onEnded( (event1) => {$w('#anchorName');})
However the last bit is not right.
I would be very grateful if someone could point me to a tutorial or tip on how to get it to go to the anchor. It's not exactly a link, because it shouldn't require a second click.
I suspect this is very easy to do, but I am having a hard time.
Thank you
Gray
import wixLocation from 'wix-location';//at the very top of the page code export function text37_click (event) { $w('#videoPlayer1').expand(); $w('#videoPlayer1').play(); $w('#videoPlayer1').onEnded( event1 => { wixLocation.to('/page-path#anchorName');// use your page path and your anchor id }); }
Thank you J.D. That's just what I need. It will work.
Have a happy new Year