線條進度條:
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中文網!
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com