Animate Heartcodes Canvas Loader With jQuery | CanvasLoader

CanvasLoader is a jQuery plugin that uses the Html5 canvas element to create an animated (preloader) with an overlay appended to the Html element.

jquery loading spinner overlay example, preloader animation jquery, preloader jquery, page loader jquery example, jquery loader plugin, page preloading effect jquery

Single Element Pure CSS Spinners & Loaders | loaderskit

How to make use of it:

1. Include the necessary jQuery CanvasLoader javascript.

<script type="text/javascript" src="heartcode-canvasloader.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

2. Include the jQuery canvasLoader plugin after the jQuery library.

<script src="index.js"></script>

3. Configure the plugin to append a loader to a DIV element.

jQuery(function ($) {
"use strict";
var element = $('<div></div>').css({
width: 500,
height: 500,
border: '3px dashed green'
}).appendTo('body');

/**
 * Initial display canvas loader
 */
element.canvasLoader({
color: '#ff0000'
});

/**
 * Remove canvas loader on the origin instance
 */
element.canvasLoader(false);

/**
 * Reactivate canvas loader on the origin instance
 */
element.canvasLoader(true);

/**
 * Remove canvas loader by event if the origin instance is not available
 */
$(element).trigger('stop.canvasLoader');

/**
 * Manipulate options of current canvas loader instance
 */
element.canvasLoader.options.color='#008000';

/**
 * Reactivate canvas loader by event if the origin instance is not available
 */
$(element).trigger('start.canvasLoader');

/**
 * Manipulate default options
 */
$.fn.canvasLoader.options.color = '#0000ff';

/**
 * Get current version.
 * @type {string}
 */
var version = $.fn.canvasLoader.version;

});

4. Available options.

//  enable the loader during initialization
start: true,

// oval, square, rect(rectangle), roundRect(rounded rectangle) and spiral
shape: 'spiral', 

// Sets hexadecimal color of the loader
color: '#000', 

// Sets the diameter of the loader
diameter: 70, 

// Sets the number of shapes drawn on the loader canvas
density: 70, 

// Sets the amount of the modified shapes in percent.
range: 0.7, 

// Sets the speed of the loader animation.
speed: 2, 

// Sets the rendering frequency.
fps: 24 

Draw and Animate PreLoaders, jQuery.CanvasLoader Plugin/Github


See Demo And Download

Official Website(orianda): Click Here

This superior jQuery/javascript plugin is developed by orianda. For extra Advanced usage, please go to the official website.

Related Posts

vuejs-dialog-plugin

Vuejs Lightweight Prompt Based On Promise And Confirm Dialog

VUEJS DIALOG PLUGIN is a lightweight, promise-based, prompt, and dialog-based alert. Important updates The dialog will always be resolved by an object. (ie a callback to continue…

Lightweight-Flexbox-Carousel-Plugin

Simple and Lightweight Flexbox Carousel Plugin With JavaScript | flexCarousel.js

Flexbox Responsive Slider – flexCarousel.js plugin is a simple and lightweight plug-in from Flexbox carousel ES6 JavaScript. An unofficial fork by Slick Carousel. Flex Carousel is a…

bootstrap-5-multi-level-dropdown

Multi-Level Dropdown Works With Bootstrap 5

Bootstrap 5 Multi-Level Dropdown, using the official HTML without adding additional CSS styles and classes, it’s just like the original support. Not all of the things listed…

jquery-confirmation-dialog

JQuery UI Built Dynamic Modal That Uses Bootstrap | confirm.js

confirm.js is to use confirm modal created using JQuery and Bootstrap. Put events in each custom button in your web application. Easy to implement, saves time. Requirements…

bootstrap-responsive-navbar

[Bootstrap 5] Responsive Navbar With off-canvas Display on Mobile

The Bootstrap 5-off-canvas navigation menu is a responsive navigation system that combines BS5 components outside of the canvas and navbar. Must Read: Pure CSS Mobile-friendly Responsive Table…

Extract-The-Dominant-Color-From-Image

Extract The Dominant Color From Image | jquery.primarycolor.js

Primary Color jQuery plugin that gets the base color of an image. A callback event that lets you apply RGB coloring to any HTML element is supported….