school-administrarion/assets/plugin/percircle/js/percircle.js

21 lines
851 B
JavaScript
Raw Normal View History

2024-05-07 19:49:43 +00:00
$(document).ready(function () {
var rotationMultiplier = 3.6;
$( ".js__circle" ).each(function() {
// Save all of its classes in an array.
var classList = $( this ).attr('class').split(/\s+/);
// Iterate over the array
for (var i = 0; i < classList.length; i++) {
if (classList[i].match("^p")) {
var rotationPercentage = classList[i].substring(1, classList[i].length);
var rotationDegrees = rotationMultiplier*rotationPercentage;
$('.c100.p'+rotationPercentage+ ' .bar').css({
'-webkit-transform' : 'rotate(' + rotationDegrees + 'deg)',
'-moz-transform' : 'rotate(' + rotationDegrees + 'deg)',
'-ms-transform' : 'rotate(' + rotationDegrees + 'deg)',
'-o-transform' : 'rotate(' + rotationDegrees + 'deg)',
'transform' : 'rotate(' + rotationDegrees + 'deg)'
});
}
}
});
});