H5 Preloader
This package has been deprecated
This package has been migrated to @cycjimmy/h5-preloader for scoped NPM package. Please switch to @cycjimmy/h5-preloader to stay up to date.
Install
# via npm $ npm install h5-preloader --save # or via yarn $ yarn add h5-preloader
Usage
; // ORconst h5Preloader = ; ;
-
h5Preloader
config:- resources: [Require][Array] Resource paths array.
- baseUrl: [Option][String] Base url for Resource paths. Default
'./'
- type: [Option][String] Set type of progress. Currently only supports
'progressBar'
. Default'progressBar'
. - progressBar: [Option][Object] Progress bar config
- eProgressBar: [Element] Element of Progress bar.
- eProgressBarPercent: [Element] Element for showing percent.
- hookWhenProgressComplete: [Option][Function] The hook function when the progress complete.
- autoComplete: [Option][Boolean] Whether to automatic operation the hook function when the progress complete. Default
true
-
h5Preloader
instance supports the following methods:load()
: Start preloader.progressComplete()
: Call the progress complete function manually.
CDN
To use via a CDN include this in your HTML:
<script src="https://cdn.jsdelivr.net/npm/h5-preloader@0/build/h5-preloader.min.js"></script>