I need my landing page that shows an animated logo to automatically transition to the main page after 5 seconds. I’ve seen past posts years ago that requires coding, how do I do this step by step in 2025 because Wix Studio’s interface is now completely different. TIA.
here is a basic code required to put on the landing page.
import wixLocation from 'wix-location';
$w.onReady(function () {
setTimeout(() => {
wixLocation.to('/main'); // change '/main' to your actual main page slug
}, 5000); // 5000 milliseconds = 5 seconds
});
Hi Dan, SOLVED! Many thanks for that.
On another note, out-in transition doesn’t work with the redirection. Is there any way or coding that can achieve out-in page transition?
you would need to manually trigger the animation.
- add a container with you logo to the landing page
import wixLocation from 'wix-location';
$w.onReady(function () {
setTimeout(() => {
$w('#mainContainer').hide('fade', {duration: 1000})
.then(() => {
wixLocation.to('/main');
});
}, 4000);
});
Thanks Dan! You’re a genius mate.
To finesse things, is there coding for the redirected page to fade ‘in’ instead of just bang appear? Sorry I feel like I should be paying you for this.
Do the same like already shown by Dan using –>
$w(‘#YourElementIdHere’).hide(‘fade’, {duration: 1000})
–> for any element on your page. Set main elements like sections to invisible (hide).
–> then let them appear slowly using the shown technique.
All you have to do on your loading page will be –>
$w.onReady(()=> {
$w('#mySectionIdHere').show('fade', {delay:100, duration:2000})
.then(()=> {console.log('...section faded-in...')});
});
This code will be inserted inside your —> /main ←- page.
Sections are set to hidden. If Section do not accept such function, then you still can achieve your aim, by setting such functionality for each element on page individually. But normaly sections should support it.
The above from @KEYBOARD-WARRIOR should work. Happy to help out the community with little things like this. If you ever need more complex issues solved feel free to reach out.
Thanks heaps KW, you guys are absolute legends!
Thanks again! I’m actually surprised this effect are not simple steps employed by wixE or wixS. Thx to you both, brownie pts collected from the boss.