Recommend this page to a friend! |
Classes of Thomas Björk | JS and CSS Resource Loader | JQUERY.md | Download |
|
|
DownloadjQuery plugin for ResourceLoaderjQuery(selector).resourceLoader(options)This is only valid for images. For a specification of the available options please see below. jQuery.resourceLoaderThis is generic and not bounded to any selectors. jQuery.resourceLoader.load(src, options)For a specification of the available options please see below. jQuery.resourceLoader.loadImage(src, options)For a specification of the available options please see below. jQuery.resourceLoader.loadImages(options)Start the automatic process of loading images. This function scans the document each 10 millisecond to see if there are new images to load. jQuery.resourceLoader.stopImageloading()Stop the automatic image loading. jQuery.resourceLoader.getVersion()Get the current version of the resourceLoader optionsThese are the options available for the resource loader. options.attributeNameWhich attribute to look for. The default value is "resource" which means that it scans for images with the attribute "data-resource-src" set. options.cacheBoolean value to indicate if the local cache should be used or not. options.cacheNameThis is the internal name used as the key in the cache. This is only available in the complete callback. To be honest. This is one value that isn't meaningful to use outside the cache management. options.cacheTimeoutThe number of seconds that should be used as a timeout for the cache. options.completeA callback that is called when the resource is loaded. This function should take one argment, the options object.
options.imageElementWhich physical image element is this image connected to. This is only available in the complete callback. options.imageTypeSpecifies which type of image this was. Currently it supports jpeg/png/gif. This is only available in the complete callback. options.loadCountThe number of active loads. This property will probably be removed since it isn't fully implemented and has also lost its meaning. This is only available in the complete callback. options.loadedFromSpecifies from where the resource has been loaded or if a test prevented it from loading. This is only available in the complete callback. options.mediaTypeSpecifies which type of data this was. How was this code treated? This property tells you if it was js, css och image. This is only available in the complete callback. options.rawsrcThis is the src defined by the data attribute. This is only available in the complete callback. options.selfThis is the internally used pointer to the resourceLoader. (Since this isn't possible to use everywhere the property self is assigned the value of this so it can be reused properly.) This is only available in the complete callback. options.srcThe src for the resource loaded. This is only available in the complete callback. options.testThis is either a callback or a boolean value. If it evaluates to true then the loading precedure is aborted. The callback function comes with the options object as an argument. This is useful to load resources that require other features.
options.waitForThis is a callback that will loop every 10 millisecond until it returns true. The callback function comes with the options object as an argument. This is useful when you have to make sure that other features has been loaded properly befor including this resource.
|