# Yahoo! UI Library

### imageloader 3.0.0

Yahoo! UI Library > imageloader > ImgLoadImgObj
Search:
Filters
Show Private Show Protected Show Deprecated

## Class ImgLoadImgObj - extends Base

Image objects to be registered with the groups

### Constructor

ImgLoadImgObj `( )`

### Properties

#### _fetched - `private Boolean`

Whether this image has already been fetched. In the case of fold-conditional groups, images won't be fetched twice.

#### _imgEl - `private Object`

The Node object returned from `Y.get`, to avoid repeat calls to access the DOM.

#### _yPos - `private Int`

The vertical position returned from `getY`, to avoid repeat calls to access the DOM. The Y position is checked only for images registered with fold-conditional groups. The position is checked first at page load (domready) and this caching enhancement assumes that the image's vertical position won't change after that first check.

#### Properties inherited from Attribute:

``

#### Properties inherited from Base:

`name`

### Methods

#### _getImgEl

`private void _getImgEl ( )`
Gets the object (as a `Y.Node`) of the DOM element indicated by "`domId`".

#### _getYPos

`private void _getYPos ( )`
Gets the Y position of the node in page coordinates. Expects that the page-coordinate position of the image won't change.

#### _init

`private void _init ( )`
Initialize all private members needed for the group.

#### fetch

`Boolean fetch ( withinY )`
Displays the image; puts the URL into the DOM. This method shouldn't be called externally, but is not private in the rare event that it needs to be called immediately.

Parameters:
  `withinY <Int>` The pixel distance from the top of the page, for which if the image lies within, it will be fetched. Undefined indicates that no check should be made, and the image should always be fetched

Returns: `Boolean`
  Whether the image has been fetched (either during this execution or previously)

#### Methods inherited from EventTarget:

`_getType, _parseType, addTarget, after, before, bubble, detach, detachAll, fire, getEvent, on, publish, removeTarget, subscribe, unsubscribe, unsubscribeAll`

#### Methods inherited from Attribute:

`_addAttrs, _addLazyAttr, _defAttrChangeFn, _fireAttrChange, _getAttr, _getAttrInitVal, _getAttrs, _getStateVal, _isLazyAttr, _normAttrVals, _protectAttrs, _set, _setAttr, _setAttrs, _setAttrVal, _setStateVal, addAttr, addAttrs, attrAdded, get, getAttrs, modifyAttr, removeAttr, reset, set, setAttrs`

#### Methods inherited from Base:

`_aggregateAttrs, _defDestroyFn, _defInitFn, _destroyHierarchy, _filterAttrCfs, _getAttrCfgs, _getClasses, _initHierarchy, _initHierarchyData, destroy, init, toString`

### Events

#### bgUrlChange

`bgUrlChange ( event )`
Fires when the value for the configuration attribute 'bgUrl' 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

#### domIdChange

`domIdChange ( event )`
Fires when the value for the configuration attribute 'domId' 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

#### enabledChange

`enabledChange ( event )`
Fires when the value for the configuration attribute 'enabled' 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

#### heightChange

`heightChange ( event )`
Fires when the value for the configuration attribute 'height' 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

#### isPngChange

`isPngChange ( event )`
Fires when the value for the configuration attribute 'isPng' 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

#### setVisibleChange

`setVisibleChange ( event )`
Fires when the value for the configuration attribute 'setVisible' 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

#### sizingMethodChange

`sizingMethodChange ( event )`
Fires when the value for the configuration attribute 'sizingMethod' 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

#### srcUrlChange

`srcUrlChange ( event )`
Fires when the value for the configuration attribute 'srcUrl' 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

#### widthChange

`widthChange ( event )`
Fires when the value for the configuration attribute 'width' 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:

`destroy, destroyedChange, init, initializedChange,`

### Configuration Attributes

#### bgUrl `- String`

Background URL for the image. For an image whose URL is specified by "`background-image`" in the element's style.

#### domId `- String`

HTML DOM id of the image element.

#### enabled `- String`

AlphaImageLoader `enabled` property to be set for the image. Only set if `isPng` value for this image is set to `true`. Defaults to `true`.

#### height `- Int`

Pixel height of the image. Will be set as a `height` attribute on the DOM element after the image is fetched. Defaults to the natural height of the image (no `height` attribute will be set). Usually only used with src images.

#### isPng `- Boolean`

Whether the image is a PNG. PNG images get special treatment in that the URL is specified through AlphaImageLoader for IE, versions 6 and earlier. Only used with background images.

#### setVisible `- Boolean`

Whether the image's `style.visibility` should be set to `visible` after the image is fetched. Used when setting images as `visibility:hidden` prior to image fetching.

#### sizingMethod `- String`

AlphaImageLoader `sizingMethod` property to be set for the image. Only set if `isPng` value for this image is set to `true`. Defaults to `scale`.

#### srcUrl `- String`

Source URL for the image. For an image whose URL is specified by a "`src`" attribute in the DOM element.

#### width `- Int`

Pixel width of the image. Will be set as a `width` attribute on the DOM element after the image is fetched. Defaults to the natural width of the image (no `width` attribute will be set). Usually only used with src images.

#### Configuration attributes inherited from Base:

`destroyed, initialized,`

Copyright © 2009 Yahoo! Inc. All rights reserved.