The label API can be used to add text elements into the visualization.
This is a method of the JSAV object.
It creates a label that is associated with some UI element of the AV
specified by the options.
Parameter msg
is the
(initial) value for the label.
Parameter options
include the following:
{before: <UI element>}
Set the label before element
UI element
{after: <UI element>}
Set the label after element
UI element
{visible: <boolean>}
Determine whether the label
is visible on creation. Defaults to true.{left/top/right/bottom: <lengthUnit>}
Values to determine the absolute position of the label relative to its container.Make the label invisible.
Make the label visible.
Set the text for the label. If the msg
parameter is left
out, this method will return the current text of the label.
Removes the DOM element of this label from the document. This is useful, for example, in re-initializing exercises when the existing label needs to be removed.
Adds the CSS class className
to the label and animates the changes.
Removes the CSS class className
from the label and animates the changes.
Toggles the CSS class className
of the label and animates the changes.
Return true/false based on if the label has the CSS class className
.