top of page

Real Preloader in Wix and Wix Studio

  • May 10, 2024
  • 1 min read


Custom Code


<div id="preloader">
<div id="loopIcon"></div>
</div>

<script type="text/javascript">
  (
 function() {
 var preload = document.getElementById("preloader");
 var isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
 var loading = 0;
 var id = setInterval(frame, 240); // SET TIME FOR PRELOADER
 function frame() {
 if (loading == 30) {
          clearInterval(id);
         preload.style.display = "none";
        } else {
          loading = loading + 1;
 if (!isMobile) {
 if (loading == 10) {
              document.getElementById("preloader").classList.add('hidden');
              }
          } else if (isMobile)
          {
 if (loading == 14) {
              document.getElementById("preloader").classList.add('hidden');
                }
          }
        }
      }
    })();
</script>

<style>
  #preloader {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 999;
    overflow: visible;
    background: #437240 url('https://static.wixstatic.com/media/*YOUR_ANIM_GIF_URL_HERE*') no-repeat center center; // CHANGE HEX COLOR OR EVEN ADD BACKGROUND IMAGE
    display: block;
    opacity: 1;
    transition: 1s opacity ease-in;
  }

#loopIcon{
width:100%;
height:100%;
background:url('https://static.wixstatic.com/media/*YOUR_GIF*2.gif') no-repeat center center; // CHANGE LINK TO GIF FROM MEDIA LIBRARY
}
  #preloader.hidden {
    opacity: 0;
  }
</style>

Enjoy!

2 Comments


carollee57522
4 days ago

Khi tìm hiểu nạp xu tiktok, mình quan tâm đến tốc độ xử lý nhưng vẫn ưu tiên sự rõ ràng. Một giao dịch tốt nên cho biết mệnh giá, số xu dự kiến, phương thức thanh toán và kết quả cuối cùng. Nếu có vấn đề thì người dùng cũng cần biết đang chờ hay phải thực hiện lại bước nào.

Like

wvi06662
5 days ago

Good evening everyone, I discovered enjoy007 after seeing it mentioned in a discussion about online casinos popular in Australia recently. I decided to open it mostly out of curiosity while relaxing at home after work. Surprisingly, the layout felt cleaner than I expected and I didn’t waste time searching for basic categories. I also liked that nothing seemed too aggressive visually, which honestly made the experience more enjoyable. Even on mobile the pages worked smoothly without strange glitches or loading issues appearing.

Like
bottom of page