Hello
I have some JavaScript which produces a circular progress bar in percentages:
Apparently, I am unable to add CSS style to the script but I can change the colours, etc. Is there a way also of changing its location on my Web page and, if so, how would I do that, please?
Thank you.
I have some JavaScript which produces a circular progress bar in percentages:
Code:
<script src="../circular-progress.js"></script>
(function () {
var n, id, progress;
progress = new CircularProgress({
radius: 20
});
document.body.appendChild(progress.el);
n = 0;
id = setInterval(function () {
if (n == 100) clearInterval(id);
progress.update(n++);
}, 100);
})();
(function () {
var n, id, progress;
progress = new CircularProgress({
radius: 40,
lineWidth: 2,
strokeStyle: 'black',
initial: {
lineWidth: 4,
strokeStyle: 'gray'
}
});
document.body.appendChild(progress.el);
n = 0;
id = setInterval(function () {
if (n == 100) clearInterval(id);
progress.update(n++);
}, 70);
})();
(function () {
var n, id, progress;
progress = new CircularProgress({
radius: 70,
strokeStyle: 'black',
lineCap: 'square',
lineJoin: 'round',
lineWidth: 5,
shadowBlur: 0,
shadowColor: 'yellow',
text: {
font: 'bold 15px arial',
shadowBlur: 0
},
initial: {
strokeStyle: 'white',
lineCap: 'square',
lineJoin: 'round',
lineWidth: 5,
shadowBlur: 10,
shadowColor: 'black'
}
});
document.body.appendChild(progress.el);
n = 0;
id = setInterval(function () {
if (n == 100) clearInterval(id);
progress.update(n++);
}, 30);
})();
Apparently, I am unable to add CSS style to the script but I can change the colours, etc. Is there a way also of changing its location on my Web page and, if so, how would I do that, please?
Thank you.