Class: mi_loader

iJS. mi_loader

new mi_loader(imgContainer, imgDir, imgLength, imgGlobalName, imgFormat)

Allow to change images for animations **it’s specialy usefull to simulate a loading**.
Parameters:
Name Type Description
imgContainer Object is an *id* name of a `HTMLImageElement` or represent a `HTMLImageElement`
imgDir string is a path where are the images to animate
imgLength number is the number of images to animate
imgGlobalName string is the global name of images to animate. egg: if *imgload* is your given global name, corresponding images names have to be *imgload0*, *imgload1*, *imgload2*, ...
imgFormat string the format of images. By default it’s *png*.
Source:

Methods

(static) changeIMGLoader(loader)

Allow to change or replace the current showing image by the next one.
Parameters:
Name Type Description
loader iJS.mi_loader Normaly, it’s the `mi_loader` instance itself, reference by `this`. But it can be any other instance of `mi_loader` class. It’s just necessary when the function is use like argument to another.
Source:
Example
var miLoader = new iJS.mi_loader(imgContainer, imgDir, imgLength, imgGlobalName, imgFormat);
        miLoader.changeIMGLoader(); //the parameter isn’t needed
        setTimeout( miLoader.changeIMGLoader, delay, miLoader ); //have to give an instance of `mi_loader` in parameter. Here it’s the object itself.
        //the parameter is needed in this case to avoid the using of `window` root object when use the reference `this` in `changeIMGLoader` function.

(static) startLoading(timeInterval)

Allow to start animation by replacing images sucessively according to a given time interval.
Parameters:
Name Type Description
timeInterval number interval of time to change images. By default it’s `150ms`.
Source:

(static) stopLoading(time)

Allow to stop animation or images changing. The animation will stop immediatly or after a given time.
Parameters:
Name Type Description
time number time to stop animation.
Source: