GIF Preloader in Head Code (Tracking & Analytics tags)

Hi guys,
I have modified a script slightly to get a fullscreen, real GIF based preloader for website.
Here’s the modified script.

  1. Copy this code.
  2. Create a new “custom tool” in your tracking & analytics settings.
  3. Paste the code and use default settings
  4. Tweak variables as per requirement to set perfect preloader

[#preloader](https://www.wix.com/code/home/forum/search/posts%3Fquery=.num.reloader) { position: fixed; width: 100%; height: 100%; z-index: 999; overflow: visible; background: [#FFFFFF](https://www.wix.com/code/home/forum/search/posts%3Fquery=.num.FFFFF) url(' [https://static.wixstatic.com/media/a9c507_e7dfa5241a674cd88e4f79eea3ec1013~mv2.gif](https://static.wixstatic.com/media/a9c507_e7dfa5241a674cd88e4f79eea3ec1013~mv2.gif) ') no-repeat center center; }

I suggest the following tweaks you can make to this-

  1. Figure out your site load time and change the value in either var id = setInterval(frame, 64); or if(loading == 90) to make the preloader time match your site loading time.
  2. Test the mobile version to check how long its staying on and modify this line if(loading == 20) to match your timing.

Cheers

2 Likes

Thank you very much, Sameer!
It works well on my wix website. I have a quick question. Can I just set up this preloader for mobile users only, because I only have slow loading issue for the mobile version? I do not code. Please keep it as simple as possible. Thank you so much again.

X2

Can I just set up this preloader for mobile users only, because I only have slow loading issue for the mobile version? I do not code.

For mobile and not coding, just use Wix welcome window for mobile devices.
https://support.wix.com/en/article/adding-a-welcome-screen-to-your-mobile-site