hd-preloader.js
An easy way to make preloader for your webapp
Getting started
Run npm install hd-preloader
and include node_modules/hd-preloader/dist/hd-prealoder.min.js
Documentation
Make a div with class .loader
on your page and add inside all thing do you want on page loading
There are just 2 options for preloader:
Option | Default value | Description |
---|---|---|
background | none | Background color |
foreground | none | Text color during loading |
Preloader have just one function:
show(show: boolean)
that you can use for toggle preloader
Examples
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Your head tag -->
</head>
<body>
<div class="loader">
<!-- Thing that you want to add -->
</div>
<!-- Your body content -->
<script src="jquery.js"></script>
<script>
var preloader = new Preloader.Preloader({
background: 'black',
foreground: 'white'
});
preloader.show(true);
$(document).ready(function() {
preloader.show(false);
});
</script>
</body>
</html>
License
See LICENSE file bundled with this package.