时间:2021-07-01 10:21:17 帮助过:6人阅读
线条进度条:
var line = new ProgressBar.Line('#example-line-container', { color: '#FCB03C' }); line.animate(1);
圆形进度条:
var circle = new ProgressBar.Circle('#example-circle-container', { color: '#FCB03C', strokeWidth: 2, fill: '#aaa' }); circle.animate(1, function() { circle.animate(0); })
自定义形状和路径:
var container = document.getElementById('example-custom-container'); container.innerHTML = '<object id="scene" type="image/svg+xml" data="images/moon-scene.svg"></object>'; var scene = document.getElementById('scene'); scene.addEventListener('load', function() { var path = new ProgressBar.Path(scene.contentDocument.querySelector('#asterism-path'), { duration: 1000 }); path.animate(1, function() { path.animate(0); }); });
更多ProgressBar.js – 漂亮的响应式 SVG 进度条相关文章请关注PHP中文网!