loading sign during reading page

Hi i have preloader which is easy hide and show text in a box. My page have some data to read and it takes like 3-5 second. Whenever i put my function it shows when dates are on. But i want to see it on blank white page during everything is loading because people dont know what is going on. Is it possbile somehow to read this loader and then rest of page?

function preloader() {
$w(‘#preloader’).show();
$w(‘#text816’).hide(‘FadeOut’);
$w(‘#text816’).show();
$w(‘#text816’).hide(‘FadeOut’);
$w(‘#text816’).show();
}

Hello

Check this preloader example: https://www.wix.com/code/home/example/Preloader

you can add the preloader on a white background that covers yous page until it loads. then you hide the preloader.

Best
Massa

but do i understand it correct. Preloader works time i set. ? If so i dont want time. i need preloader hide when page is loaded therefore i have function that i hide preloader after last item loaded. my codes reads quite long therefore my question was is it possible to read preloadre first and run and then rest of site?

Yes of course, you keep the preloader shown. after you page is done loading you can simply hide it without setting fixed time.

you treat the preloader as an element on the page that is shown by default and then you hide it
$w(‘#Preloader’).hide()

Best