Graphics Reference
In-Depth Information
Suppose we use the following symbol composition, in which we want to
access three different elements with the selector function in order to hide them:
Figure 5.16
A representative symbol composition
with child elements
To save a reference of a child element as a variable, we need to formulate the
statement as follows:
// sym.$("name") folds an Edge Animate element name
// into a DOM element that can be used
// with jQuery.
var element = sym.$("ELEMENTNAME");
Here also, the selector function is provided by each symbol, so you can nest
the call however you choose. Suppose you want to hide the blue element (“Rec-
tA”). The statement then looks as follows:
var element = sym.$("RectA");
element.hide();
Since the selector function returns a full jQuery object, you can use shorthand
here if you do not need the reference for other actions:
sym.$("RectA").hide();
If, however, you want to hide the red elements within the symbol (“MySym-
bol”) , the statement should read as follows:
var symbol = sym.getSymbol("MySymbol");
var element = symbol.$("RectB");
element.hide();
 
Search WWH ::




Custom Search