🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

The preloadinator jQuery plugin helps you create a CSS based animated loading indicator that is fully controllable and configurable via JavaScript. Ideal for both loader and preloader.

loading-indicator preloader loader

Documentation

preloadinator

A super-lightweight preloader plugin powered by jQuery ⚡️

Dependencies

Preloadinator requires the dependencies listed below.

Quickstart

  1. Write HTML markup for your preloader
<div class="preloader js-preloader"> </div>
  1. Write CSS styling for the preloader & include this into your HTML file
.preloader { 	position: fixed; 	top: 0; 	left: 0; 	width: 100%; 	height: 100%; 	background: #60D7A9; }
  1. Add jQuery & preloadinator.min.js right before your closing <body> tag
<script src="http://code.jquery.com/jquery-3.3.1.min.js"></script> <script src="dist/jquery.preloadinator.min.js"
  1. Initialise your preloader & include this into your HTML file
$('.js-preloader').preloadinator();
  1. Kick back & relax 🍺

Options

Option Type Default Description
scroll boolean false Enable/disable scrolling when the preloader is displayed
minTime integer 0 Minimum amount of time to display preloader (in milliseconds)
animation function fadeOut Animation used to remove the preloader when the page has loaded
animationDuration integer 400 Duration of animation (in milliseconds)

Use the options above like so:

$('.js-preloader').preloadinator({ 	scroll: false, 	minTime: 2000, 	animation: slideUp, 	animationDuration: 600 });

Callbacks

Callback Description
afterDisableScroll This callback is fired after scrolling is disabled (if scroll option is set to false)
afterEnableScroll This callback is fired after scrolling is enabled (if scroll option is set to false)
afterRemovePreloader This callback is fired after the preloader is removed from the view

Use the callbacks above like so:

$('.js-preloader').preloadinator({ 	afterDisableScroll: function() { 		alert('Scrolling has just been disabled.'); 	}, 	afterEnableScroll: function() { 		alert('Scrolling has just been enabled.'); 	}, 	afterRemovePreloader: function() { 		alert('The preloader has just been removed.'); 	} });

Happy coding! 🤖

— Leon


You May Also Like