在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):lightningtgc/MProgress.js开源软件地址(OpenSource Url):https://github.com/lightningtgc/MProgress.js开源编程语言(OpenSource Language):JavaScript 59.7%开源软件介绍(OpenSource Introduction):MProgress.jsGoogle Material Design Progress Linear bar. It uses CSS3 and vanilla JavaScript which doesn't depend on any other libraries. Types and previewType 1. Type 2. Type 3. Type 4. Or you can see all types together: Vedio:Material Progress & activity DEMOHow to startInstall itInclude <link rel='stylesheet' href='mprogress.min.css'/>
<script src='mprogress.min.js'></script> You can also install it via Bower or npm:
Basic usageExample for the 1.Instantiation: var mprogress = new Mprogress(); 2.Show and start the bar by using: mprogress.start(); Or you can just use var mprogress = new Mprogress('start'); //start it immediately 3.Finish the loading and hide it : mprogress.end(); Advanced usageAll types have Type1: Determinate
set(n)Sets the progress bar status, where eg: mprogress.set(0.3); inc()Increases by a random amount. eg: mprogress.inc(); // Increase the bar with a random amount.
mprogress.inc(0.3); // This will get the current status value and adds 0.3 until status is 0.994 Type2: BufferIts always used for video loading, and you can use for other case. Init Type Buffer : var bufferIntObj = {
template: 2
};
var bufferProgress = new Mprogress(bufferIntObj); Start it:bufferProgress.start(); If you want to start it immediately after instantiating it,you can use: var bufferIntObj = {
template: 2, // type number
start: true // start it now
};
var bufferProgress = new Mprogress(bufferIntObj); End it:bufferProgress.end();
Type
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论