html5+css3圆形百分比进度条动画加载完成显示检测得分特效

来源:https://www.sucaihuo.com/js/3470.html 2018-02-16 21:32浏览(2994) 收藏

html5+css3圆形百分比进度条动画加载完成显示检测得分特效,类似杀毒软件扫描检测电脑健康度loading加载动画,扫描完显示得分情况。
html5+css3圆形百分比进度条动画加载完成显示检测得分特效
分类:统计图 > 圆形百分比 难易:初级
查看演示 下载资源 下载积分: 10 积分

js代码

<script language="javascript">
    function doit(oid, n) {
        var o = document.getElementById(oid);
        var i = parseInt(o.innerHTML) + 1;
        if (isNaN(i)) i = 0;
        o.innerHTML = i.toString();
        if (i < n) setTimeout('doit(\'' + oid + '\',' + n + ')', 100);
    }
    //doit('score', 100);
    var slots={},c=document.getElementById('loadingProgress'),ctx=c.getContext('2d');
    window.hasLoaded = 0;
    window.loading = false;
    window.ulp = ulp;
    function ulp(percent){
        window.loading = true;
        var i = 0, draw = null;
        draw = setInterval(function(){
            if (window.hasLoaded > 100) {
                window.loading = false;
                clearInterval(draw);
                draw = null;
                return true;
            }

            if (i<percent) {
                d();
                i++;
                window.hasLoaded += 1;
            } else {
                clearInterval(draw);
                draw = null;
            }
        }, 10);
    }

    function d(){
        var lp = document.getElementById('loadedNum');
        lp.innerHTML = window.hasLoaded;

        var loaded = window.hasLoaded * 2 / 100 * Math.PI, cw = 250, hcw = 125;
        ctx.clearRect (0,0,cw,cw);
        ctx.beginPath();
        ctx.arc(hcw,hcw,hcw-4, 0, loaded, false);
        ctx.lineWidth = 40;
        ctx.strokeStyle = '#ffb400';
        ctx.stroke();
    }
    //ulp(69);

    $(function(){
        doit('score', 100);
        setTimeout(function(){
            $(".score_content").hide();
            $("#splash").show();
            ulp(69);
        },11000);
    })

</script>
评论0
头像

系统已开启自动识别垃圾评论机制,识别到的自动封号,下载出错或者资源有问题请联系全栈客服QQ 1915635791

1 2