简体   繁体   English

预加载器不会消失

[英]Preloader doesn't disappear

Hey I am trying to add preloader to my website but whatever I do it won't disappear or it stays above the page or something like that.嘿,我正在尝试将预加载器添加到我的网站,但无论我做什么,它都不会消失,或者它会停留在页面上方或类似的东西上。 I tried a lot of things but nothing works even though I tried to copy the same code that should work.我尝试了很多东西,但即使我尝试复制应该可以工作的相同代码,也没有任何效果。

 // Attempt 1 $(document).ready(function () { $(".loader").fadeOut("slow"); }); // Attempt 2 // setTimeout(function () { // $(".loader").fadeToggle(); // }, 3000);
 .loader { background: #111; width: 100%; height: 100vh; display: flex; justify-content: center; align-items: center; position: fixed; z-index: 1; }.loader div { background: #fff; width: 16px; height: 32px; margin-left: 10px; animation: loader 1.2s infinite; } @keyframes loader { 50% { height: 64px; } }.loader div:nth-child(1) { background: #ff9f1a; animation-delay: -0.4s; }.loader div:nth-child(2) { background: #fed330; animation-delay: -0.2s; }.loader div:nth-child(3) { background: #fffa65; animation-delay: 0s; }
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <div class="loader"> <div></div> <div></div> <div></div> </div>

The slim version of the jQuery library doesn't have the fadeOut function. jQuery 库的精简版没有fadeOut function。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM