Alloy UI

imageloader  1.0.1

 
Filters

Class ImgLoadGroup - extends Base

A group for images. A group can have one time limit and a series of triggers. Thus the images belonging to this group must share these constraints.

Constructor

ImgLoadGroup ( )

Properties inherited from Attribute:

Properties inherited from Base:

Configuration Attributes

className - String

Class name that will identify images belonging to the group. This class name will be removed from each element in order to fetch images. This class should have, in its CSS style definition, "background:none !important;".

foldDistance - Number

Distance below the fold for which images are loaded. Images are not loaded until they are at most this distance away from (or above) the fold. This check is performed at page load (domready) and after any window scroll or window resize event (until all images are loaded).

name - String

Name for the group. Only used to identify the group in logging statements.

timeLimit - Number

Time limit, in seconds, after which images are fetched regardless of trigger events.

Configuration attributes inherited from Base:

Methods

addCustomTrigger

void addCustomTrigger ( name , obj )
Adds a custom event trigger to the group.
Parameters:
name <String> The name of the event
obj <Object> The object on which to attach the event. obj is optional - by default the event is attached to the Y instance
Chainable: This method is chainable.

addTrigger

void addTrigger ( obj , type )
Adds a trigger to the group. Arguments are passed to Y.on.
Parameters:
obj <Object> The DOM object to attach the trigger event to
type <String> The event type
Chainable: This method is chainable.

fetch

void fetch ( )
Displays the images in the group. This method is called when a trigger fires or the time limit expires; it shouldn't be called externally, but is not private in the rare event that it needs to be called immediately.

registerImage

Object registerImage ( * )
Registers an image with the group. Arguments are passed through to a Y.ImgLoadImgObj constructor; see that class' attribute documentation for detailed information. "domId" is a required attribute.
Parameters:
* <Object> A configuration object literal with attribute name/value pairs (passed through to a Y.ImgLoadImgObj constructor)
Returns: Object
Y.ImgLoadImgObj that was registered

Events

classNameChange

classNameChange ( event )
Fires when the value for the configuration attribute 'className' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

foldDistanceChange

foldDistanceChange ( event )
Fires when the value for the configuration attribute 'foldDistance' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

nameChange

nameChange ( event )
Fires when the value for the configuration attribute 'name' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

timeLimitChange

timeLimitChange ( event )
Fires when the value for the configuration attribute 'timeLimit' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

Events inherited from Base: