Create a new taggd instance
Param | Type | Default | Description |
---|---|---|---|
image | HTMLElement | The image to wrap | |
[options] | Object | {} | The options |
[data] | Array | [] | The tags |
Subscribe to an event.
Kind: instance method of Taggd
Returns: Taggd - Current Taggd instance
Param | Type | Description |
---|---|---|
eventName | String | The event to subscribe to. |
handler | function | The handler to execute. |
Unsubscribe from an event.
Kind: instance method of Taggd
Returns: Taggd - Current Taggd instance
Param | Type | Description |
---|---|---|
eventName | String | The event to unsubscribe from. |
handler | function | The handler that was used to subscribe. |
Subscribe to an event and unsubscribe once triggered.
Kind: instance method of Taggd
Returns: Taggd - Current Taggd instance
Param | Type | Description |
---|---|---|
eventName | String | The event to subscribe to. |
handler | function | The handler to execute. |
Set taggd options
Kind: instance method of Taggd
Returns: Taggd - Current Taggd instance
Param | Type | Description |
---|---|---|
options | Object | The options to set |
Add a single tag
Kind: instance method of Taggd
Returns: Taggd - Current Taggd instance
Param | Type | Description |
---|---|---|
tag | Taggd.Tag | The tag to add |
Get a single tag by index
Kind: instance method of Taggd
Returns: Taggd.Tag - The tag to get
Param | Type | Description |
---|---|---|
index | Number | The index of the desired tag |
Delete a single tag by index
Kind: instance method of Taggd
Returns: Taggd - Current Taggd instance
Param | Type | Description |
---|---|---|
index | Number | The index of the desired tag |
Set all tags
Kind: instance method of Taggd
Returns: Taggd - Current Taggd instance
Param | Type | Description |
---|---|---|
tags | Array.<Taggd.Tag> | An array of tags |
Add multiple tags
Kind: instance method of Taggd
Returns: Taggd - Current Taggd instance
Param | Type | Description |
---|---|---|
tags | Array.<Taggd.Tag> | An array of tags |
Get all tags
Kind: instance method of Taggd
Returns: Array.<Taggd.Tag> - All tags of this Taggd instance
Remove all tags
Kind: instance method of Taggd
Returns: Taggd - Current Taggd instance
Iterate and replace all tags
Kind: instance method of Taggd
Returns: Taggd - Current Taggd instance
Param | Type | Description |
---|---|---|
callback | function | The callback to execute for all tags |
Clean up memory
Kind: instance method of Taggd
Returns: Taggd - Current Taggd instance
Enable editor mode
Kind: instance method of Taggd
Returns: Taggd - Current Taggd instance
Disable editor mode
Kind: instance method of Taggd
Returns: Taggd - Current Taggd instance