如果是50%,圆环进度一半,以此类推。。。
回复讨论(解决方案)
试试:Highcharts
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8" /><script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script><script src="highcharts.js"></script><title>open source</title></head><body> <div class="project_item_process"> <div class="project_item_table" id="p1"> <label>90%</label> </div> </div><script type="text/javascript">$(function(){ $(".project_item_table").each(function(i,item){ var ok=parseInt($(this).find('label').html().replace("%","")), fl=100-ok; $(this).highcharts({ chart:{ type:'pie', width:130, height:130 }, plotOptions:{ pie:{ innerSize:65, colors:['green','#ddd'], dataLabels:{enabled:false} } }, title:{ text:ok+'%', verticalAlign:'middle', y:2, userHtml:true, fontFamily:'微软雅黑' }, credits:{enabled:false}, tooltip:{enabled:false}, legend:{enabled:false}, series:[{ data:[ok,fl] }] }); });});</script></body></html>
以上代码需要Highcharts JS v3.0.0以上,我本地测试用的是v4,公司的程序用的是v3
<!doctype html><html lang="en"><head> <meta charset="UTF-8" /> <title> 页面名称 </title><style type="text/css"></style></head><body><canvas id="canvasId" width="400" height="350"></canvas><script type="text/javascript"> var canvas = document.getElementById("canvasId"); var cxt = canvas.getContext("2d"); function loading(i) //渲染loading { cxt.save(); cxt.strokeStyle = "#373842"; cxt.fillStyle = "#16161b"; cxt.lineWidth = 2; cxt.beginPath(); cxt.arc(canvas.width>>1,canvas.height>>1,60,0,2*Math.PI,false); cxt.closePath(); cxt.fill(); cxt.stroke(); cxt.strokeStyle = "#83b0fc"; cxt.shadowColor = "#b5c7fd"; cxt.shadowBlur = 5; cxt.lineWidth = 5; cxt.lineCap= "round"; cxt.beginPath(); cxt.arc(canvas.width>>1,canvas.height>>1,50,-0.5*Math.PI,2*Math.PI*(i/100-0.25),false); cxt.stroke(); cxt.fillStyle = "#6699ff"; cxt.font = "18px Arial"; cxt.textAlign = "center"; cxt.fillText("Loading...",canvas.width>>1,canvas.height>>1); cxt.fillText(Math.round(i)+"%",canvas.width>>1,(canvas.height>>1)+20); cxt.restore(); }function rt(i) { loading(i); if(i<100) setTimeout(function () { rt(i+1); }, 200);}rt(0);</script></body></html>
刚好最近公司需要,虽然我是个实习生,但自己练习写了一个,希望对你有帮助~
<!doctype html><html><head><meta charset="utf-8"><title>circle</title></head><script type="text/javascript">function JinDu(){ var demo=document.getElementById("y"); var CircleX=demo.getContext("2d"); CircleX.clearRect(0, 0, 400, 400); var Max={ x:200, y:200, r:100 } var Min={ x:200, y:200, r:80 } var Circlevar={ x:200, y:200, r:90 } CircleX.lineWidth="18"; CircleX.beginPath(); CircleX.strokeStyle="black"; CircleX.arc(Min.x,Min.y,Min.r,Math.PI*1.5, Math.PI*3.5, false); CircleX.stroke(); CircleX.beginPath(); CircleX.arc(Max.x,Max.y,Max.r,Math.PI*1.5, Math.PI*3.5, false); CircleX.stroke(); var x=document.getElementById("in").value; var y=1.5+x/100*2; console.log(y); CircleX.beginPath(); CircleX.strokeStyle="green"; CircleX.arc(Circlevar.x,Circlevar.y,Circlevar.r,Math.PI*1.5, Math.PI*y, false); CircleX.stroke();}</script><body> <canvas style="background:#FFC" height="400" width="400" id="y"></canvas> <input type="text" id="in"> <input type="submit" onclick="JinDu()"></body></html>

HTML, CSS and JavaScript are the core technologies for building modern web pages: 1. HTML defines the web page structure, 2. CSS is responsible for the appearance of the web page, 3. JavaScript provides web page dynamics and interactivity, and they work together to create a website with a good user experience.

The function of HTML is to define the structure and content of a web page, and its purpose is to provide a standardized way to display information. 1) HTML organizes various parts of the web page through tags and attributes, such as titles and paragraphs. 2) It supports the separation of content and performance and improves maintenance efficiency. 3) HTML is extensible, allowing custom tags to enhance SEO.

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.


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

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

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

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Zend Studio 13.0.1
Powerful PHP integrated development environment

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