Yahoo! UI Library

imageloader  2.5.2

Yahoo! UI Library > imageloader > YAHOO.util.ImageLoader.group

Show Private Show Protected

Class YAHOO.util.ImageLoader.group

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

YAHOO.util.ImageLoader.group ( trigEl , trigAct , timeout )
Parameters:
trigEl <String|HTMLElement> The HTML element id or reference to assign the trigger event to. Can be null for no trigger
trigAct <String> The type of event to assign to trigEl. Can be null for no trigger
timeout <Number> Timeout (time limit) length, in seconds. Can be undefined, or <= 0, for no time limit

Properties

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;"

foldConditional - Boolean

Flag to check if images are above the fold. If foldConditional is true, the group will check each of its image locations at page load. If any part of the image is within the client viewport, the image is displayed immediately

name - String

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

timeoutLen - Number

Timeout (time limit) length, in seconds

Methods

addCustomTrigger

void addCustomTrigger ( event )
Adds a custom event trigger to the group.
Parameters:
event <Object> A YAHOO.util.CustomEvent object
Returns: void

addTrigger

void addTrigger ( trigEl , trigAct )
Adds a trigger to the group. Call this with the same style as YAHOO.util.Event.addListener
Parameters:
trigEl <String|HTMLElement> The HTML element id or reference to assign the trigger event to
trigAct <String> The type of event to assign to trigEl
Returns: void

fetch

void fetch ( )
Displays the images in the group
Returns: void

registerBgImage

Object registerBgImage ( domId , url )
Registers a background image with the group
Parameters:
domId <String> HTML DOM id of the image element
url <String> URL for the image
Returns: Object
bgImgObj that was registered, for modifying any attributes in the object

registerPngBgImage

Object registerPngBgImage ( domId , url , ailProps )
Registers an alpha-channel-type png background image with the group
Parameters:
domId <String> HTML DOM id of the image element
url <String> URL for the image
ailProps <Object> The AlphaImageLoader properties to be set for the image Valid properties are 'sizingMethod' and 'enabled'
Returns: Object
pngBgImgObj that was registered, for modifying any attributes in the object

registerSrcImage

Object registerSrcImage ( domId , url , width , height )
Registers a src image with the group
Parameters:
domId <String> HTML DOM id of the image element
url <String> URL for the image
width <Int> pixel width of the image - defaults to image's natural size
height <Int> pixel height of the image - defaults to image's natural size
Returns: Object
srcImgObj that was registered, for modifying any attributes in the object


Copyright © 2007 Yahoo! Inc. All rights reserved.