This time I will show you how to use Yuanshengcss3 to realize ring loading Progress bar, and use Yuanshengcss3 to realize ring loading progress bar What are the precautions, as follows This is a practical case, let’s take a look at it.
Rendering:
The requirement at that time was to make the progress bar gradient in a fan shape Effects loading. I thought about it for a long time, and it seems that the only way to make a gradient image is to use border-img. Another super stupid method is to write 50 rectangles distributed on the progress bar. The gradients provided by css3 include linear gradients, radial gradients and repeating gradients. I can't figure out how to achieve a fan-shaped gradient. No more talking, let’s get to the code:
nbsp;html> <meta> <title>Document</title> <style> *{ margin: 0; padding: 0; } .wrap,.circle,.percent{ position: absolute; width: 200px; height: 200px; border-radius: 50%; } .wrap{ top:50px; left:50px; background-color: #ccc; } .circle{ box-sizing: border-box; border:20px solid #ccc; clip:rect(0,200px,200px,100px); } .clip-auto{ clip:rect(auto, auto, auto, auto); } .percent{ box-sizing: border-box; top:-20px; left:-20px; } .left{ transition:transform ease; border:20px solid blue; clip: rect(0,100px,200px,0); } .right{ border:20px solid blue; clip: rect(0,200px,200px,100px); } .wth0{ width:0; } .num{ position: absolute; box-sizing: border-box; width: 160px; height: 160px; line-height: 160px; text-align: center; font-size: 40px; left: 20px; top: 20px; border-radius: 50%; background-color: #fff; z-index: 1; } </style> <script></script> <p> </p><p> </p><p></p> <p></p> <p><span>0</span>%</p> <script> var percent=0; var loading=setInterval(function(){ if(percent>100){ percent=0; $('.circle').removeClass('clip-auto'); $('.right').addClass('wth0'); }else if(percent>50){ $('.circle').addClass('clip-auto'); $('.right').removeClass('wth0'); } $('.left').css("-webkit-transform","rotate("+(18/5)*percent+"deg)"); $('.num>span').text(percent); percent++; },200); </script>
I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the PHP Chinese website!
Recommended reading:
Summary of the basic use of js
##How to avoid features and browser inference in JS
The above is the detailed content of How to use source css3 to implement a ring loading progress bar. For more information, please follow other related articles on the PHP Chinese website!

Here's a container with some child elements:

Flyout menus! The second you need to implement a menu that uses a hover event to display more menu items, you're in tricky territory. For one, they should

"The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect."- Tim Berners-Lee

In this week's roundup: datepickers are giving keyboard users headaches, a new web component compiler that helps fight FOUC, we finally get our hands on styling list item markers, and four steps to getting webmentions on your site.

The short answer: flex-shrink and flex-basis are probably what you’re lookin’ for.

In this week's look around the world of web platform news, Google Search Console makes it easier to view crawled markup, we learn that custom properties

The IndieWeb is a thing! They've got a conference coming up and everything. The New Yorker is even writing about it:


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Linux new version
SublimeText3 Linux latest version

Dreamweaver CS6
Visual web development tools