October 10, 2000 - Determining HTML+TIME's Active Elements
October 10, 2000 Determining HTML+TIME's Active Elements Tips: October 2000
Yehuda Shiran, Ph.D.
|
activeElements
collection groups all elements participating in the t:PAR
element and are currently active. The following example (based on a Microsoft script) demonstrates the usage of activeElements
. When you click the button, we print the active elements along the timeline. Since they come and go, you will get different printout every time you click the button. We iterate through the active elements with the Enumerator
object and its four methods: atEnd()
, moveFirst()
, moveNext()
, and item()
. Here is the function that prints the active elements of the page:
function printLinks() {
linkEnum = new Enumerator(parallel.activeElements);
for (linkEnum.moveFirst(); !linkEnum.atEnd(); linkEnum.moveNext()) {
alert("Active Element: " + linkEnum.item().id);
}
}
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Learn more about HTML+TIME in Column 67, Introduction to HTML+TIME.