A wrapper for image icon, CSS sprite icon, or DOM Button.
Icon is a simple utility class for creating an image icon, a CSS sprite icon, or a DOM Button. It calls dojox/mobile/iconUtils.createIcon() with the appropriate parameters to create an icon. Note that this module is not a widget, that is it does not inherit from dijit/_WidgetBase.
Parameter | Type | Description |
---|---|---|
args | Object |
Optional Contains properties to be set. |
node | DomNode |
Optional The DOM node. If none is specified, it is automatically created. |
See the dojox/mobile/Icon reference documentation for more information.
Image icon:
<div data-dojo-type="dojox.mobile.Icon" data-dojo-props='icon:"images/tab-icon-12h.png"'></div>
CSS sprite icon:
<div data-dojo-type="dojox.mobile.Icon" data-dojo-props='icon:"images/tab-icons.png",iconPos:"29,116,29,29"'></div>
DOM Button:
<div data-dojo-type="dojox.mobile.Icon" data-dojo-props='icon:"mblDomButtonBlueCircleArrow"'></div>
An alt text for the icon image. Note that changing the value of the property after the icon creation has no effect.
An icon to display. The value can be either a path for an image file or a class name of a DOM button. Note that changing the value of the property after the icon creation has no effect.
The position of an aggregated icon. IconPos is comma separated values like top,left,width,height (ex. "0,0,29,29"). Note that changing the value of the property after the icon creation has no effect.