Monday, February 16th, 2009
xLazyLoader: Lazy loader callback framework
<p>Oleg Slobodskoi, guru behind jimdo.com, has open sourced xLazyLoader a jQuery plugin that lets you asynchronously load resources such as JavaScript, CSS, and images. Quite useful if you want to head of and load some CSS to do something custom and you need the callback.Example
-
-
$.xLazyLoader({
-
js: ['ui.core.js','ui.dialog.js'],
-
css: ['ui.core.css', 'ui.dialog.css'],
-
image: ['your_image.jpg', 'your_image1.jpg', 'your_image2.jpg'],
-
name: 'dialog',
-
load: function(){
-
alert('All files are loaded');
-
}
-
});
-
Features
- load one or multiple files for each type
- onload callback for javascript, CSS and images
- prevents double loaded scripts or css files
- method to remove scripts/css by using group name
- method to disable/enable css files by using group name, so you can use this plugin like a css switcher
- Tested in IE6, IE7, FF2/3, Opera 9, Safari 3, Chrome
Related Content:











Leave a comment