Hello guys!
In my website I have a welcome page and wanted to do something like the “welcome page” on the mobile site function.
So, what I did is to create a landing page with a welcome message and would like to redirect this to another page (URL) after a time delay of 2 seconds or whatever…
I looked up on internet for some javascript code and nothing works…
If the code can work on mobile and desktop, it would be great! So I can have the same for mobile and desktop.
Thank you guys!
I appreciate your help!!!
This is the code I found on the forum and doesn’t work for me ar the moment:
import wixWindow from 'wix-window';
import wixLocation from 'wix-location';
$w.onReady(() => {
setTimeout(()=>{
if(wixWindow.formFactor === 'Mobile'){
wixLocation.to('https://www.mysite.com’)
} else {
wixLocation.to('https://www.mysite.com')
}
} , 5000)
})