Constructor
new MultiStateSpritesIcon(url, bgWidth, bgHeight, sizeopt, unitopt, statesopt, scaleopt, decorationopt, …args)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
url |
String | the URL of the image resource |
|
bgWidth |
Number | the total width of the image resource |
|
bgHeight |
Number | the total height of the image resource |
|
size |
Number |
<optional> |
the size of the icon; defaults to |
unit |
String |
<optional> |
the CSS unit used for all dimension attributes; defaults to |
states |
Object.<String, qui.icons.MultiStateSpritesIcon.StateDetails> |
<optional> |
a mapping with icon states |
scale |
Number |
<optional> |
icon scaling factor; defaults to |
decoration |
String |
<optional> |
icon decoration |
args |
* |
<repeatable> |
parent class parameters |
- Source:
Extends
Methods
applyTo(element)
Apply the icon to an HTML element.
Parameters:
Name | Type | Description |
---|---|---|
element |
jQuery | the element to which the icon will be applied |
- Overrides:
- Source:
hasState(state) → {Boolean}
Tell if the icon has a given state.
Parameters:
Name | Type | Description |
---|---|---|
state |
String |
- Source:
Returns:
- Type
- Boolean
renderTo(element)
Effectively render the icon onto the HTML element.
Parameters:
Name | Type | Description |
---|---|---|
element |
jQuery | the element onto which the icon will be rendered |
- Overrides:
- Source:
toAttributes() → {Object}
Return a dictionary of icon attributes that can be passed to constructor.
- Overrides:
- Source:
Returns:
- Type
- Object
Type Definitions
StateDetails
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
offsetX |
Number | the X offset of the icon in the sprites image |
offsetY |
Number | the Y offset of the icon in the sprites image |
filter |
String | a CSS filter to apply to the icon |
- Source: