Skip to content

simple jQuery loading icon manager

harikr2006/jquery.loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#jQuery loader plugin

This is a simple jQuery plugin for managing a loading icon.

##basic usage

var ldr = $.loader({
	image: 'loader_black.gif'
});

ldr.show();

You can pass an options object to the plugin with several parameters. At the momente these parameters are:

  • image - (url of an image)
  • backgroundClass - (class of the background element)
  • loaderClass - (the class name of the loader element)

You can also pass a options object to the show and hide function that can contain pretty neat things like

  • elements - a jQuery object (or a array of objects) that will be overlayed by the loader
  • after - a function that will be executet right after the function finishes

##Example

var ldr = $.loader({
	image: 'loader_black.gif'
});

ldr.show({
	elements: [$('body'), $(#myElement)],
	after: function() {
		window.setTimeout(
			function() {ldr.hide();},
			3000
		);
	}
});

or a little more complex:

var ldr = $.loader({
	image: 'loader_black.gif'
});

ldr.show({
	elements: $('pre'),
	after: function() {
		window.setTimeout(function() {
			ldr.hide({
				after: function() {alert('finished loading');}
			});
		}, 3000);
	}
});

##Demo

demo link

About

simple jQuery loading icon manager

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published