当前位置:首页 > 建站技巧 > 为你的主题加上loading效果

为你的主题加上loading效果

admin1年前 (2022-11-15)建站技巧1020
※ 声明:本站为非商业性博客,内容均为本站网友收集于互联网公开分享,仅限于学习和探讨的目的,不得将上述内容用于非法或商业途径,版权争议与本站无关,如有冒犯,请留言删除!

第一步: 新建一个loading样式css 

将以下代码放进去 然后引用这个文件

#Loadanimation{
    background-color:#fff;
    height:100%;
    width:100%;
    position:fixed;
    z-index:1;
    margin-top:0px;top:0px;
    
}
#Loadanimation-center{
    width:100%;
    height:100%;
    position:relative;
    
}
#Loadanimation-center-absolute{
    position:absolute;
    left:50%;
    top:50%;
    height:200px;
    width:200px;
    margin-top:-100px;
    margin-left:-100px;
    
}
.xccx_object{
    -moz-border-radius:50% 50% 50% 50%;
    -webkit-border-radius:50% 50% 50% 50%;
    border-radius:50% 50% 50% 50%;
    position:absolute;
    border-left:5px solid #87CEFA;
    border-right:5px solid #FFC0CB;
    border-top:5px solid transparent;
    border-bottom:5px solid transparent;
    -webkit-animation:animate 2.5s infinite;
    animation:animate 2.5s infinite;
    
}
#xccx_one{
    left:75px;
    top:75px;
    width:50px;
    height:50px;
    
}
#xccx_two{
    left:65px;
    top:65px;
    width:70px;
    height:70px;
    -webkit-animation-delay:0.1s;
    animation-delay:0.1s;
    
}
#xccx_three{
    left:55px;
    top:55px;
    width:90px;
    height:90px;
    -webkit-animation-delay:0.2s;animation-delay:0.2s;
    
}
#xccx_four{
    left:45px;
    top:45px;
    width:110px;
    height:110px;
    -webkit-animation-delay:0.3s;
    animation-delay:0.3s;
    
}
@-webkit-keyframes animate{50%{
    -ms-transform:rotate(180deg);
    -webkit-transform:rotate(180deg);
    transform:rotate(180deg);
    
}
100%{-ms-transform:rotate(0deg);
    -webkit-transform:rotate(0deg);
    transform:rotate(0deg);
    
}
    
}
@keyframes animate{50%{
    -ms-transform:rotate(180deg);
    -webkit-transform:rotate(180deg);
    transform:rotate(180deg);
    
}
100%{
    -ms-transform:rotate(0deg);
    -webkit-transform:rotate(0deg);
    transform:rotate(0deg);
    
}
}

第二步:将以下代码填写入头部文件 一般都为 header.php

<div id="Loadanimation" style="z-index:999999;">
<div id="Loadanimation-center">
    <div id="Loadanimation-center-absolute">
        <div class="xccx_object" id="xccx_four"></div>
        <div class="xccx_object" id="xccx_three"></div>
        <div class="xccx_object" id="xccx_two"></div>
        <div class="xccx_object" id="xccx_one"></div>
    </div>
</div>
</div>
<script>
$(function(){ 
    $("#Loadanimation").fadeOut(540); 
});
</script>

注意:fadeOut 里面填写的是毫秒数  

本loading可以自定义 网上也有很多css的 只要替换第二步的代码都可以成功(js代码别替换)

※ 感谢您的支持,如果喜欢本内容,请打赏本站!谢谢!
打赏 支付宝打赏 微信打赏

扫描二维码推送至手机访问。

版权声明:本文由 鹦鹉台 发布,如需转载请注明出处。

本文链接:https://zimtv.cn/tool/为你的主题加上loading效果.html

分享给朋友:

“为你的主题加上loading效果” 的相关文章

嘉峪关电视台直播源

嘉峪关电视台直播源

嘉峪关综合,http://play.kankanlive.com/live/1658978094528926.m3u8 嘉峪关公共,http://play.kankanlive.com/live/1...

酷狗音乐MV轮播PHP

酷狗音乐MV轮播PHP

<?php  header("Content-Type: text/html; charset=UTF-8"); $id =&nb...

网页定时展示代码

网页定时展示代码

网页定时展示代码:var PlayList={     list:{ '06:00':'播放内容一',...

Lightbox弹出层插件:jQuery弹出层插件用法

Lightbox弹出层插件:jQuery弹出层插件用法

Lightbox弹出层插件说明文档  :1.引入资源,(JQ1.3+)和JS文件<script type="text/javascript" s...

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。