The plugins site is currently in development.
We've been looking to provide a higher-quality, spam-free experience at the plugins site for some time, and a major error on our part forced us to shut down the current site before we could put the new one in place. We are developing a new site, and you can follow along with its development on GitHub. For more information about this transition, including steps you can take as a plugin author to prepare, please read our post about what's going on.
PfeLoader
This is a preloader, it scans DOM and loaded StyleSheet's for occurence of images (in sheet, style, as element).
StyleSheet file has to be in the same domain as page using it.
Each callback function's 'this' object has three attributes: loaded, count, timeout.
Usage:
- PfeLoader.start({onStart=null, onChange=null, onStop=null, imgs=[], timeout=0, findImages=true});
- will start preloading of images
- onStart, onChange, onStop are functions which will be ran on event occurence.
- imgs is an array of img srcs
- timeout is a timeout after which script will stop wait for an image,
setting it to 0 (default) results in no timeout. - findImages whatever scan for images in DOM is needed
- PfeLoader.demo({onStart=null, onChange=null, onStop=null, imgs=[], timeout=0, findImages=true});
- arguments are the same as in start(),
this method can be used to test our callbacks. It searches for images and gets it count, next it increments counters and runs callbacks when applicable.
- arguments are the same as in start(),
Example:
$(function(){
$.PfeLoader.start({onStart:function(){
document.title='started';
},onChange:function(){
document.title=this.loaded + "/" + this.timeout + " : "+ this.count +
" (" + (parseInt((this.loaded+this.timeout)/this.count*100)) + ")";
},onDone:function(){
document.title='stopped';
}})
})