这次我们来说一下常见的几种loding效果实现,loding效果实现需要注意哪几点,下面就是实战案例,一起来看一下。
<html> <head> <meta charset="UTF-8"> <title>Loading</title> <link rel="stylesheet" type="text/css" href="loading.css"> <style> .loader { float: left; } .loader { position: relative; width: 5rem; height: 5rem; } .loader.small { -webkit-transform: scale(.5); transform: scale(.5); } .loader.circle-line, .loader.circle-round { height: 5rem; } /*circle-line*/ .loader.circle-line span { position: absolute; display: inline-block; width: 1.5rem; height: .5rem; border-top-left-radius: .25rem; border-bottom-left-radius: .25rem; background: #1ABC9C; opacity: .05; -webkit-animation: circle-line 1s ease infinite; animation: circle-line 1s ease infinite; } .loader.circle-line span:nth-child(1) { top: 50%; left: 0; margin-top: -.25rem; -webkit-animation-delay: .13s; animation-delay: .13s; } .loader.circle-line span:nth-child(2) { top: 1rem; left: .5rem; -webkit-transform: rotate(45deg); transform: rotate(45deg); -webkit-animation-delay: .26s; animation-delay: .26s; } .loader.circle-line span:nth-child(3) { left: 50%; top: .5rem; margin-left: -.75rem; -webkit-transform: rotate(90deg); transform: rotate(90deg); -webkit-animation-delay: .39s; animation-delay: .39s; } .loader.circle-line span:nth-child(4) { right: .5rem; top: 1rem; -webkit-transform: rotate(145deg); transform: rotate(145deg); -webkit-animation-delay: .52s; animation-delay: .52s; } .loader.circle-line span:nth-child(5) { left: 3.5rem; top: 50%; margin-top: -.25rem; -webkit-transform: rotate(180deg); transform: rotate(180deg); -webkit-animation-delay: .65s; animation-delay: .65s; } .loader.circle-line span:nth-child(6) { bottom: 1rem; right: .5rem; -webkit-transform: rotate(-145deg); transform: rotate(-145deg); -webkit-animation-delay: .78s; animation-delay: .78s; } .loader.circle-line span:nth-child(7) { left: 50%; bottom: .5rem; margin-left: -15px; -webkit-transform: rotate(-90deg); transform: rotate(-90deg); -webkit-animation-delay: .91s; animation-delay: .91s; } .loader.circle-line span:nth-child(8) { bottom: 1rem; left: .5rem; -webkit-transform: rotate(-45deg); transform: rotate(-45deg); -webkit-animation-delay: 1.04s; animation-delay: 1.04s; } @keyframes circle-line { 0% { opacity: .05; } 100% { opacity: .7; } } @-webkit-keyframes circle-line { 0% { opacity: .05; } 100% { opacity: .7; } } /*circle-line-spin*/ .loader.circle-line-spin .circle-line-inner { width: 100%; height: 100%; -webkit-animation: circle-line-spin 1.5s linear infinite; animation: circle-line-spin 1.5s linear infinite; } .loader.circle-line-spin span { position: absolute; display: inline-block; width: 1.5rem; height: .5rem; border-top-left-radius: .25rem; border-bottom-left-radius: .25rem; background: #1ABC9C; opacity: .7; } .loader.circle-line-spin span:nth-child(1) { top: 50%; left: 0; margin-top: -.25rem; } .loader.circle-line-spin span:nth-child(2) { top: 1rem; left: .5rem; -webkit-transform: rotate(45deg); transform: rotate(45deg); } .loader.circle-line-spin span:nth-child(3) { left: 50%; top: .5rem; margin-left: -.75rem; -webkit-transform: rotate(90deg); transform: rotate(90deg); } .loader.circle-line-spin span:nth-child(4) { right: .5rem; top: 1rem; -webkit-transform: rotate(145deg); transform: rotate(145deg); } .loader.circle-line-spin span:nth-child(5) { left: 3.5rem; top: 50%; margin-top: -.25rem; -webkit-transform: rotate(180deg); transform: rotate(180deg); } .loader.circle-line-spin span:nth-child(6) { bottom: 1rem; right: .5rem; -webkit-transform: rotate(-145deg); transform: rotate(-145deg); } .loader.circle-line-spin span:nth-child(7) { left: 50%; bottom: .5rem; margin-left: -15px; -webkit-transform: rotate(-90deg); transform: rotate(-90deg); } .loader.circle-line-spin span:nth-child(8) { bottom: 1rem; left: .5rem; -webkit-transform: rotate(-45deg); transform: rotate(-45deg); } @keyframes circle-line-spin { 0% { transform: rotate(0); } 100% { transform: rotate(360deg); } } @-webkit-keyframes circle-line-spin { 0% { -webkit-transform: rotate(0); } 100% { -webkit-transform: rotate(360deg); } } /*circle-round*/ .loader.circle-round span { opacity: .05; -webkit-animation: circle-round 1s ease infinite; animation: circle-round 1s ease infinite; } .loader.circle-round-fade span { -webkit-animation: circle-round-fade 1s ease infinite; animation: circle-round-fade 1s ease infinite; } .loader.circle-round span, .loader.circle-round-fade span { position: absolute; width: .8rem; height: .8rem; display: inline-block; border-radius: 50%; background: #1ABC9C; } .loader.circle-round span:nth-child(1), .loader.circle-round-fade span:nth-child(1) { top: 50%; left: 0; margin-top: -.4rem; -webkit-animation-delay: -1.04s; animation-delay: -1.04s; } .loader.circle-round span:nth-child(2), .loader.circle-round-fade span:nth-child(2) { top: .7rem; left: .7rem; -webkit-animation-delay: -.91s; animation-delay: -.91s; } .loader.circle-round span:nth-child(3), .loader.circle-round-fade span:nth-child(3) { top: 0; left: 50%; margin-left: -.4rem; -webkit-animation-delay: -.78s; animation-delay: -.78s; } .loader.circle-round span:nth-child(4), .loader.circle-round-fade span:nth-child(4) { right: .7rem; top: .7rem; -webkit-animation-delay: -.65s; animation-delay: -.65s; } .loader.circle-round span:nth-child(5), .loader.circle-round-fade span:nth-child(5) { right: 0; top: 50%; margin-top: -.4rem; -webkit-animation-delay: -.52s; animation-delay: -.52s; } .loader.circle-round span:nth-child(6), .loader.circle-round-fade span:nth-child(6) { bottom: .7rem; right: .7rem; -webkit-animation-delay: -.39s; animation-delay: -.39s; } .loader.circle-round span:nth-child(7), .loader.circle-round-fade span:nth-child(7) { bottom: 0; left: 50%; margin-left: -.4rem; -webkit-animation-delay: -.26s; animation-delay: -.26s; } .loader.circle-round span:nth-child(8), .loader.circle-round-fade span:nth-child(8) { left: .7rem; bottom: .7rem; -webkit-animation-delay: -.13s; animation-delay: -.13s; } @keyframes circle-round { 0% { opacity: .05; } 100% { opacity: .7; } } @-webkit-keyframes circle-round { 0% { opacity: .05; } 100% { opacity: .7; } } @keyframes circle-round-fade { 0% { opacity: .25; transform: scale(.2); } 100% { opacity: 1; transform: scale(1); } } @-webkit-keyframes circle-round-fade { 0% { opacity: .25; transform: scale(.2); } 100% { opacity: 1; transform: scale(1); } } /*line-square*/ .loader.line-square { width: 6rem; height: .8rem; } .loader.line-square span { position: absolute; top: 0; width: .8rem; height: .8rem; display: inline-block; background: #1ABC9C; -webkit-animation: line-square 1s ease infinite; animation: line-square 1s ease infinite; } .loader.line-square span:nth-child(1) { left: 0; -webkit-animation-delay: .13s; animation-delay: .13s; } .loader.line-square span:nth-child(2) { left: 1.3rem; -webkit-animation-delay: .26s; animation-delay: .26s; } .loader.line-square span:nth-child(3) { left: 2.6rem; -webkit-animation-delay: .39s; animation-delay: .39s; } .loader.line-square span:nth-child(4) { left: 3.9rem; -webkit-animation-delay: .52s; animation-delay: .52s; } .loader.line-square span:nth-child(5) { left: 5.2rem; -webkit-animation-delay: .65s; animation-delay: .65s; } @keyframes line-square { 0% { opacity: 1; transform: scale(1.2); -webkit-transform: scale(1.2); } 100% { opacity: .2; transform: scale(.2); -webkit-transform: scale(.2); } } @-webkit-keyframes line-square { 0% { opacity: 1; transform: scale(1.2); -webkit-transform: scale(1.2); } 100% { opacity: .2; transform: scale(.2); -webkit-transform: scale(.2); } } /*line-round*/ .loader.line-round { width: 6rem; height: .8rem; } .loader.line-round span { position: absolute; top: 0; width: .8rem; height: .8rem; border-radius: 50%; display: inline-block; background: #1ABC9C; -webkit-animation: line-round 1s ease infinite; animation: line-round 1s ease infinite; } .loader.line-round span:nth-child(1) { left: 0; -webkit-animation-delay: .13s; animation-delay: .13s; } .loader.line-round span:nth-child(2) { left: 1.3rem; -webkit-animation-delay: .26s; animation-delay: .26s; } .loader.line-round span:nth-child(3) { left: 2.6rem; -webkit-animation-delay: .39s; animation-delay: .39s; } .loader.line-round span:nth-child(4) { left: 3.9rem; -webkit-animation-delay: .52s; animation-delay: .52s; } .loader.line-round span:nth-child(5) { left: 5.2rem; -webkit-animation-delay: .65s; animation-delay: .65s; } @keyframes line-round { 0% { opacity: 1; transform: scale(1.2); -webkit-transform: scale(1.2); } 100% { opacity: .2; transform: scale(.2); -webkit-transform: scale(.2); } } @-webkit-keyframes line-round { 0% { opacity: 1; transform: scale(1.2); -webkit-transform: scale(1.2); } 100% { opacity: .2; transform: scale(.2); -webkit-transform: scale(.2); } } /*line-bounce*/ .loader.line-bounce { width: 6rem; height: 2.5rem; } .loader.line-bounce span { position: absolute; top: 0; width: .5rem; height: 2.5rem; border-radius: 5px; display: inline-block; background: #1ABC9C; -webkit-animation: line-bounce 1s ease infinite; animation: line-bounce 1s ease infinite; } .loader.line-bounce span:nth-child(1) { left: 0; -webkit-animation-delay: -.65s; animation-delay: -.65s; } .loader.line-bounce span:nth-child(2) { left: 1.3rem; -webkit-animation-delay: -.78s; animation-delay: -.78s; } .loader.line-bounce span:nth-child(3) { left: 2.6rem; -webkit-animation-delay: -.91s; animation-delay: -.91s; } .loader.line-bounce span:nth-child(4) { left: 3.9rem; -webkit-animation-delay: -.78s; animation-delay: -78s; } .loader.line-bounce span:nth-child(5) { left: 5.2rem; -webkit-animation-delay: -.65s; animation-delay: -.65s; } @keyframes line-bounce { 0% { transform: scaleY(1); } 50% { transform: scaleY(.3); } 100% { transform: scaleY(1); } } @-webkit-keyframes line-bounce { 0% { -webkit-transform: scaleY(1); } 50% { -webkit-transform: scaleY(.3); } 100% { -webkit-transform: scaleY(1); } } /*circle-spin*/ .loader.circle-spin { border-radius: 50%; border: .2rem solid rgba(0, 0, 0, .05); width: 4rem; height: 4rem; box-sizing: content-box; } .loader.circle-spin .loader-placeholder { position: absolute; top: -.2rem; left: -.2rem; border-radius: 50%; border: .2rem solid transparent; border-top: .2rem solid #1ABC9C; width: 4rem; height: 4rem; box-sizing: content-box; -webkit-animation: circle-spin 1s ease infinite; animation: circle-spin 1s ease infinite; } @keyframes circle-spin { 0% { transform: rotate(0); } 100% { transform: rotate(360deg); } } @-webkit-keyframes circle-spin { 0% { -webkit-transform: rotate(0); } 100% { -webkit-transform: rotate(360deg); } } </style> </head> <body> <div> <div class="loader circle-line small"> <span></span> <span></span> <span></span> <span></span> <span></span> <span></span> <span></span> <span></span> </div> <div class="loader circle-line-spin small"> <div> <span></span> <span></span> <span></span> <span></span> <span></span> <span></span> <span></span> <span></span> </div> </div> <div class="loader circle-round small"> <span></span> <span></span> <span></span> <span></span> <span></span> <span></span> <span></span> <span></span> </div> <div class="loader circle-round-fade small"> <span></span> <span></span> <span></span> <span></span> <span></span> <span></span> <span></span> <span></span> </div> <div class="loader line-square small"> <span></span> <span></span> <span></span> <span></span> <span></span> </div> <div class="loader line-round small"> <span></span> <span></span> <span></span> <span></span> <span></span> </div> <div class="loader line-bounce small"> <span></span> <span></span> <span></span> <span></span> <span></span> </div> <div class="loader circle-spin small"> <div></div> </div> </div> </body> </html>
相信看了这些案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!
相关阅读:
以上是常见的几种loding效果实现的详细内容。更多信息请关注PHP中文网其他相关文章!

随着互联网的发展,SEO(SearchEngineOptimization,搜索引擎优化)已经成为了网站优化的重要一环。如果您想要使您的PHP网站在搜索引擎中获得更高的排名,就需要对SEO的内容有一定的了解了。本文将会介绍如何在PHP中实现SEO优化,内容包括网站结构优化、网页内容优化、外部链接优化,以及其他相关的优化技巧。一、网站结构优化网站结构对于S

随着电子商务和企业管理的发展,许多企业开始寻找更好的方法来处理其日常业务流程。ERP系统是一种能够整合企业各种业务流程的软件工具。它提供了全面的功能,包括生产、销售、采购、库存、财务等方面,帮助企业提高效率、控制成本和提高客户满意度。而在PHP编程语言中,也能够实现ERP系统,这就需要我们掌握一些基本的知识和技术。下面,我们将深入探讨如何在PHP中实现ERP

随着物联网技术的发展和普及,越来越多的应用场景需要使用PHP语言进行物联网开发。PHP作为一种广泛应用于Web开发的脚本语言,它的易学易用、开发速度快、可扩展性强等特点,使其成为开发物联网应用的一种优秀选择。本文将介绍在PHP中实现物联网开发的常用技术和方法。一、传输协议和数据格式物联网设备通常使用TCP/IP或UDP协议进行数据传输,而HTTP协议是一个优

随着企业的发展,客户管理变得越来越重要。为了提高客户满意度和忠诚度,越来越多的企业采用客户关系管理系统(CRM)来帮助其管理客户关系。而PHP是一种流行的编程语言,因其简单易学、灵活和强大而被广泛应用于Web开发。那么,如何在PHP中实现CRM系统呢?本文将为您介绍实现CRM系统的步骤和技巧。Step1:需求分析在开始开发CRM系统之前,您需要进行需求分析

随着互联网的发展,轮播图已经成为了网页设计中必不可少的一部分。在很多网页中,轮播图经常被用作展示企业文化、最新产品或是推广活动等场景。本篇文章将会分享如何使用PHP来实现轮播图的功能。一、轮播图的概念轮播图是网页中一种常见的视觉效果,一般由多个图片组成,在页面中自动或手动进行切换,展示多个内容。可以添加符合业务要求的动画效果,有助于引起用户的关注和提高网站的

智能合约(SmartContract)是一种基于区块链的自动化交易程序,可以实现自动化执行、验证和执行交易。智能合约可以减少交易中的人为干扰,提高交易的安全性和效率。在不同的区块链中,智能合约的实现方式略有不同。本文将介绍在PHP中如何实现智能合约。PHP是一种广泛使用的编程语言,特别适合Web开发。PHP有着成熟的开源生态系统,以及许多可靠的框架和库。在

随着互联网的不断发展,越来越多的网站需要使用验证码来保证安全性。验证码是一种借助人类能力而无法被计算机破解的认证技术,广泛应用于网站注册、登录、找回密码等功能中。下面将介绍如何使用PHP实现验证码功能。一、生成验证码图片验证码图片的生成是验证码功能的核心,需要生成一个随机字符,并将其渲染为图像展示给用户。在PHP中,可以使用GD库来生成图片。GD库是一种用于

随着移动互联网的发展,微信已经成为了人们生活中不可或缺的一部分,越来越多的商家选择在微信平台上开展业务。实现微信支付功能对于商家来说是非常必要的。本文将介绍如何使用PHP实现JSAPI支付。首先,我们需要了解什么是JSAPI支付。JSAPI是微信公众号支付功能的一种,通过JS调用微信支付接口实现支付。JSAPI支付的优点在于用户只需要在微信中进行支付,不需要


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

Dreamweaver CS6
视觉化网页开发工具

螳螂BT
Mantis是一个易于部署的基于Web的缺陷跟踪工具,用于帮助产品缺陷跟踪。它需要PHP、MySQL和一个Web服务器。请查看我们的演示和托管服务。

ZendStudio 13.5.1 Mac
功能强大的PHP集成开发环境

记事本++7.3.1
好用且免费的代码编辑器

DVWA
Damn Vulnerable Web App (DVWA) 是一个PHP/MySQL的Web应用程序,非常容易受到攻击。它的主要目标是成为安全专业人员在合法环境中测试自己的技能和工具的辅助工具,帮助Web开发人员更好地理解保护Web应用程序的过程,并帮助教师/学生在课堂环境中教授/学习Web应用程序安全。DVWA的目标是通过简单直接的界面练习一些最常见的Web漏洞,难度各不相同。请注意,该软件中