resloader
Overview
A image preloaded plugin and can display the loaded image progress bar
Install
Install resloader
npm install resloader
Import resloader
ES6/commonjs import style is supported.
// ES6; // commonjsvar resloader = ;
or link as a script in an html file.
Usage
// imageData expected a JSON// url is requiredlet imageData = name: images1 url: imageUrl name: images1 url: imageUrl name: images1 url: imageUrl, name: audio url: audioUrl// or imageData can be an Arraylet imageData = imageUrl imageUrl imageUrl audioUrl const options = resources: imageData //imageData expected a JSON or Array { console } { console } { console console } ;
options
Option | Description | default | type | Function Params Description |
---|---|---|---|---|
resources | preload images/audio data | - | JSON, Array | - |
onStart | callback when preload on started | - | Function | total: preload images total |
onProgress | callback when preload on loading | - | Function | currentIndex:loaded images number total:preload images total |
onComplete | callback when preload on complete | - | Function | total: preload images total result: preload images data(the same as resources) |
LICENSE
MIT@chenyinkai