new module:Tag(tagName)
Parameters:
| Name | Type | Description |
|---|---|---|
tagName |
string | SVG tag identifier ( |
Members
-
$el :jQuery.element
-
jQuery element for this tag
-
id :string
-
unique ID of this SVG object
-
id
-
set id of this SVG object
-
id
-
get id of this SVG object
-
tagName :string
-
SVG tag identifier (
rect,image,PolyLine)
Methods
-
addAttr(assoc)
-
set attributes of this element
Parameters:
Name Type Description assocObject javascript object that will be mapped into attributes (
{key: value}->key="value") -
addClass(name)
-
add a class to this element
Parameters:
Name Type Description namestring class name to be added
-
checkIfElementExistsInDOM()
-
check if the element exists in dom, if so, refetch it from DOM using jQuery
-
get() → {jQuery.element}
-
get jQuery element for this SVG object
Returns:
jQuery.element -
getAttr(name) → {string}
-
get attribute value by name
Parameters:
Name Type Description namestring name of the attribute
Returns:
string -value of the attribute
-
removeAttr(name)
-
remove attribute by value
Parameters:
Name Type Description namestring name of the attribute to be removed
-
removeClasses(…classes)
-
remove class names from this element
Parameters:
Name Type Attributes Description classesstring <repeatable>
class names to be removed