first commit
This commit is contained in:
BIN
assets/plugin/percircle/js/._percircle.js
Executable file
BIN
assets/plugin/percircle/js/._percircle.js
Executable file
Binary file not shown.
21
assets/plugin/percircle/js/percircle.js
Executable file
21
assets/plugin/percircle/js/percircle.js
Executable file
@ -0,0 +1,21 @@
|
||||
$(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)'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user