Class ImgLoadImgObj
- extends Base
Image objects to be registered with the groups
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 Base:
Methods
private
void
_getImgEl
(
)
Gets the object (as a Y.Node
) of the DOM element indicated by "domId
".
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.
private
void
_init
(
)
Initialize all private members needed for the group.
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
(
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
(
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
(
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
(
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
(
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
(
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
(
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
(
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
(
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:
Configuration Attributes
Background URL for the image.
For an image whose URL is specified by "background-image
" in the element's style.
HTML DOM id of the image element.
AlphaImageLoader enabled
property to be set for the image.
Only set if isPng
value for this image is set to true
.
Defaults to true
.
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.
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.
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.
AlphaImageLoader sizingMethod
property to be set for the image.
Only set if isPng
value for this image is set to true
.
Defaults to scale
.
Source URL for the image.
For an image whose URL is specified by a "src
" attribute in the DOM element.
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: