Lightbox to redirect to an external url?

I currently have this code

import wixLocation from ‘wix-location’;
$w.onReady( function () {
setTimeout(() => {
wixLocation.to(“REDIRECTED SITE URL”);
}, 5000);
});

The idea is that the lightbox will be triggered by a button, once this is hit a lightbox will display a notice and then after 5 seconds redirect to another website. I cannot get it to work? any ideas where I am going wrong

Thanks

Have a read of these previous forum posts.
https://www.wix.com/corvid/forum/community-discussion/set-timeout-for-lightbox
https://www.wix.com/corvid/forum/community-discussion/how-to-delay-going-to-a-link-after-clicking