dojox/mobile/Icon (version 1.10)

Summary

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.

Usage

var foo = new Icon(args,node);
dojox/mobile/Icon
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.

Examples

Example 1

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>

Property Summary

  • altAn alt text for the icon image.
  • iconAn icon to display.
  • iconPosThe position of an aggregated icon.
  • tagThe name of the HTML tag to create as this.domNode.

Method Summary

Properties

alt
Defined by: dojox/mobile/Icon

An alt text for the icon image. Note that changing the value of the property after the icon creation has no effect.

icon
Defined by: dojox/mobile/Icon

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.

iconPos
Defined by: dojox/mobile/Icon

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.

tag
Defined by: dojox/mobile/Icon

The name of the HTML tag to create as this.domNode.

Methods

_setCustomTransform()
Defined by dojox/mobile/Icon

To be implemented in bidi/Icon.js.

Error in the documentation? Can’t find what you are looking for? Let us know!