当前位置: 首页 > news >正文

为你的网站加上Loading等待加载效果吧 | Loading页面加载添加教程

为你的网站加上Loading等待加载效果吧 | Loading页面加载添加教程

效果图 :

教程开始

新建一个loading样式css
将以下代码放进去 然后引用这个文件

code

  1. #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

code

  1. <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代码别替换)

http://www.lryc.cn/news/44580.html

相关文章:

  • Redis安装和配置
  • MobTech|如何使用秒验
  • CSS实现自动分页打印同时每页保留重复的自定义内容
  • 基于prometheus的监控告警怎么实现?
  • 2007年4月全国计算机等级考试二级JAVA笔试试题及答案
  • 灌水玩玩 ChatGPT AIGC生成的有栈协同程序实现(例子)
  • 【砝码称重】暴力DFS(一半分)+ dp(可AC)
  • 科大奥瑞物理实验——霍尔效应实验
  • 2023_深入学习HTML5
  • Apache iotdb-web-workbench 认证绕过漏洞(CVE-2023-24829)
  • 【7-1】Redis急速入门与复习
  • 5、操作系统——进程间通信(3)(system V-IPC:消息队列)
  • C++vector容器用法详解
  • Log4j2的Loggers详解
  • 计算机视觉的应用1-OCR分栏识别:两栏识别三栏识别都可以,本地部署完美拼接
  • 低代码平台如何选型, 43款国内外低代码平台一网打尽
  • 第六周作业(1.5小时)
  • 排序 (蓝桥杯) JAVA
  • 【Blender 水墨材质】实现过程剖析01
  • 代码随想录算法训练营第五十六天|583. 两个字符串的删除操作、72. 编辑距离
  • 【ArchLinux】【KDE】Archlinux的安装与使用
  • Go语言精修(尚硅谷笔记)第六章
  • Photoshop的功能
  • C++初阶——内存管理
  • uds服务汇总
  • 【深度学习】2023李宏毅homework1作业一代码详解
  • 【软件测试】基础知识第二篇
  • Java中File类以及初步认识流
  • 【C语言】文件操作详细讲解
  • 爱奇艺万能联播使用教程