第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何在 2 秒后停止加載動畫?

如何在 2 秒后停止加載動畫?

HUX布斯 2021-12-23 19:05:11
我想制作一個加載屏幕和一個淡入淡出的頁面,如下所示:https : //www.w3schools.com/howto/tryit.asp?filename=tryhow_css_loader5。問題是我不知道如何結束加載循環(huán)并使其褪色。代碼        <body>            <div class="sk-chase">                <div class="sk-chase-dot"></div>                <div class="sk-chase-dot"></div>                <div class="sk-chase-dot"></div>                <div class="sk-chase-dot"></div>                <div class="sk-chase-dot"></div>                <div class="sk-chase-dot"></div>            </div>         </body>body {        background-color: #636e72;    }sk-chase {      width: 40px;      height: 40px;      animation: sk-chase 2.5s infinite linear both;      display: flex;      justify-content: center;      align-items: center;      margin: 0 auto;      top: 50%;      left: 50%;      position: absolute;    }    .sk-chase-dot {      width: 100%;      height: 100%;      position: absolute;      left: 0;      top: 0;       animation: sk-chase-dot 2.0s infinite ease-in-out both;     }.sk-chase-dot:before {      content: '';      display: block;      width: 25%;      height: 25%;      background-color: #fff;      border-radius: 100%;      animation: sk-chase-dot-before 2.0s infinite ease-in-out both;     @keyframes sk-chase {      100% { transform: rotate(360deg); }     }    @keyframes sk-chase-dot {      80%, 100% { transform: rotate(360deg); }     }    @keyframes sk-chase-dot-before {      50% {        transform: scale(0.4);       } 100%, 0% {        transform: scale(1.0);       }     }
查看完整描述

2 回答

?
Qyouu

TA貢獻1786條經驗 獲得超11個贊

animation: sk-chase 2.5s infinite linear both;

Wordinfinite是你的問題。改為使用多個代表infinite。在你的情況下是1。


查看完整回答
反對 回復 2021-12-23
?
慕森卡

TA貢獻1806條經驗 獲得超8個贊

您需要 JavaScript 來告訴瀏覽器何時隱藏加載程序并顯示內容。見下面的片段


var myVar;


function myFunction() {

  myVar = setTimeout(showPage, 3000);

}


function showPage() {

  document.querySelector("#loader").style.display = "none";

  document.querySelector("#myDiv").style.display = "block";

  document.querySelector("body").style.backgroundColor = "white";

}

body {

  background-color: #636e72;

}


.sk-chase {

  width: 40px;

  height: 40px;

  animation: sk-chase 2.5s infinite linear both;

  display: flex;

  justify-content: center;

  align-items: center;

  margin: 0 auto;

  top: calc(50% - 20px);

  left: calc(50% - 20px);

  position: absolute;

}


.sk-chase-dot {

  width: 100%;

  height: 100%;

  position: absolute;

  left: 0;

  top: 0;

  animation: sk-chase-dot 2.0s infinite ease-in-out both;

}


.sk-chase-dot:before {

  content: '';

  display: block;

  width: 25%;

  height: 25%;

  background-color: #fff;

  border-radius: 100%;

  animation: sk-chase-dot-before 2.0s infinite ease-in-out both;

}


.sk-chase-dot:nth-child(1) {

  animation-delay: -1.1s;

}


.sk-chase-dot:nth-child(2) {

  animation-delay: -1.0s;

}


.sk-chase-dot:nth-child(3) {

  animation-delay: -0.9s;

}


.sk-chase-dot:nth-child(4) {

  animation-delay: -0.8s;

}


.sk-chase-dot:nth-child(5) {

  animation-delay: -0.7s;

}


.sk-chase-dot:nth-child(6) {

  animation-delay: -0.6s;

}


.sk-chase-dot:nth-child(1):before {

  animation-delay: -1.1s;

}


.sk-chase-dot:nth-child(2):before {

  animation-delay: -1.0s;

}


.sk-chase-dot:nth-child(3):before {

  animation-delay: -0.9s;

}


.sk-chase-dot:nth-child(4):before {

  animation-delay: -0.8s;

}


.sk-chase-dot:nth-child(5):before {

  animation-delay: -0.7s;

}


.sk-chase-dot:nth-child(6):before {

  animation-delay: -0.6s;

}


@keyframes sk-chase {

  100% {

    transform: rotate(360deg);

  }

}


@keyframes sk-chase-dot {

  80%,

  100% {

    transform: rotate(360deg);

  }

}


@keyframes sk-chase-dot-before {

  50% {

    transform: scale(0.4);

  }

  100%,

  0% {

    transform: scale(1.0);

  }

}

<body onload="myFunction()">

  <div id="loader" class="sk-chase">

    <div class="sk-chase-dot"></div>

    <div class="sk-chase-dot"></div>

    <div class="sk-chase-dot"></div>

    <div class="sk-chase-dot"></div>

    <div class="sk-chase-dot"></div>

    <div class="sk-chase-dot"></div>

  </div>

  <div style="display:none;" id="myDiv" class="animate-bottom">

    <h2>Tada!</h2>

    <p>Some text in my newly loaded page..</p>

  </div>

</body>


查看完整回答
反對 回復 2021-12-23
  • 2 回答
  • 0 關注
  • 166 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號