javascript - JQUERY Circular Progress Bar Loops Method -
i have found script of jquery circular progress bar percent given below , looks want more make circular bar duplicate in html editor multiple skills percentage (html, css, js, php) every skills has different % when duplicate html code of circle bar shows same percentage of particular skill in duplicate circle bar. think there use loop in jquery don't have idea how deal it, highly appreciated ?
$(function(){ var $ppc = $('.progress-pie-chart'), percent = parseint($ppc.data('percent')), deg = 360*percent/100; if (percent > 50) { $ppc.addclass('gt-50'); } $('.ppc-progress-fill').css('transform','rotate('+ deg +'deg)'); $('.ppc-percents span').html(percent+'%'); });
@mixin circle($size) { content: ""; position: absolute; border-radius: 50%; left: calc(50% - #{$size/2}); top: calc(50% - #{$size/2}); width: $size; height: $size; } $size: 200px; .progress-pie-chart { width: $size; height: $size; border-radius: 50%; background-color: #e5e5e5; position: relative; &.gt-50 { background-color: #81ce97; } } .ppc-progress { @include circle($size); clip: rect(0, $size, $size, #{$size/2}); .ppc-progress-fill { @include circle($size); clip: rect(0, #{$size/2}, $size, 0); background: #81ce97; transform: rotate(60deg); } .gt-50 & { clip: rect(0, #{$size/2}, $size, 0); .ppc-progress-fill { clip: rect(0, $size, $size, #{$size/2}); background: #e5e5e5; } } } .ppc-percents { @include circle(#{$size/1.15}); background: #fff; text-align: center; display: table; span { display: block; font-size: 2.6em; font-weight: bold; color: #81ce97; } } .pcc-percents-wrapper { display: table-cell; vertical-align: middle; } .progress-pie-chart { margin: 50px auto 0; }
<div class="progress-pie-chart" data-percent="34"> <div class="ppc-progress"> <div class="ppc-progress-fill"></div> </div> <div class="ppc-percents"> <div class="pcc-percents-wrapper"> <span>%</span> </div> </div> </div>
`
Comments
Post a Comment