Auto Loading Page

Hi all,

I have followed a forum post from 2018, about an auto-loading page. I have followed the steps given, which were to paste the following code. However, how do I connect the lightbox animation, to the code?

$w.onReady( function () {
import wixLocation from ‘wix-location’ ;

$w.onReady( function () {
setTimeout(() => {
wixLocation.to( “/home” );
}, 10000 );
});

Also, its red lined the word ‘import’ - anything wrong?

Delete the first line of your code. You have the same line of code a few lines later (and in the correct place).

What do you mean by “Lightbox Animation”?

Thanks for the quick response. I am wanting to upload an animation (basically a transparent video), of a circle bouncing up and down. I shall try your above recommendations

It worked perfectly! Now to upload my own animation. Thanks again

Sorry, me again. Whilst I think of it, I would like to apply this lightbox, animated feature to a few pages (pages that show my portfolio). In order for this to work, how do I apply this to those pages?

I understand that within the settings of the lightbox, you can select which pages. However, when I go to those pages, it doesnt work

@harleyweber I don’t really understand what you are trying to accomplish. Do you want to open the Lightbox from several different pages? You can use the openLightbox() function.

@yisrael-wix Apologoes for the brief message. When a user goes to my site, it will initially show the lightbox loading page. Then, if a user clicks ‘work’, whilst the page is gathering all of my design portfolio work in the background, it will have the lightbox pop up again, as a loading page.

Have you got an article link that I can refer to for the above function you mentioned, or is it easy to add?

@harleyweber You might want to use a Box instead of a Lightbox. A Box is a much “lighter” element and is commonly used to display a “preloader” animation.

The Preloader for File Upload example illustrates how to display a preloader (animated image) while the site is busy performing some task. You can adapt this to your own use.

hey @yisrael-wix ! Firstly thank you so much for your tips. I applied this code to my site. However, the welcome page just never transitions to Home. It just stays on the welcome page. Am I missing something?

import wixLocation from ‘wix-location’ ;

$w . onReady ( function () {
setTimeout (() => {
wixLocation . to ( “/Home” );
}, 10000 );
});

Not sure, but you might want lowercase home :

wixLocation.to("/home");

I’ll give that a shot thanks man. And am I posted it on the page code or main js…

Not sure what you mean by main js…

In your case, it seems like you want to put it on the welcome page. It will then redirect to the home page in 10 seconds.