lucasvallenet / js-loader

Simulate a loader by loading one image after another.

Home Page:http://studiometa.github.io/js-loader

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Loader

js-loader is a script that simulates a loader by loading one image after another. It allows you to run a callback after each image loaded and when all images are loaded.

Used for the loader on Signes du quotidien.

Use

var images = [
	'<img data-src="image.jpg">',
	'<img data-src="image.jpg">',
	'<img data-src="image.jpg">',
	'<img data-src="image.jpg">',
	'<img data-src="image.jpg">',
	'<img data-src="image.jpg">',
	'<img data-src="image.jpg">'
];

var loader = new Loader(images, {
	attr: 'data-src',
	onImageLoad: function(percentage) {
		console.log(percentage);
	},
	onComplete: function() {
		console.log('Chargement terminé !');
	}
});

About

Simulate a loader by loading one image after another.

http://studiometa.github.io/js-loader


Languages

Language:HTML 64.1%Language:JavaScript 35.9%