spacer
Yehuda Shiran October 11, 2000
Deriving HTML+TIME's Active Time
Tips: October 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

The HTML+TIME capability in IE 5.5 and up is based on the timeline principle. Some applications require that you know exactly the time you are at. You do it by using the currTimeState object, which is a property of any container that participates in the HTML+TIME behavior. One of currTimeState's many properties and methods is the activeTime property. The activeTime property reports the exact time the script is on. The following example (based on a Microsoft script) demonstrates the usage of activeTime. When you click the button, we print the active time. Since it is instantanous, you will see a larger number every time you click the button. Here is the function that prints the active time of the timeline:

function printTime() {
  var now = parallel.currTimeState.activeTime;
  alert(now.toFixed(2));
}

And here is the Demo:

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6
Here is the HTML code:

<INPUT TYPE="button" value="Show Active Time" onclick="printTime()">
<t:PAR CLASS="time" ID="parallel" REPEATCOUNT="indefinite">
    <H1 ID="hdg1" CLASS="time" STYLE="color:red;" 
	TIMEACTION="style" BEGIN="0" DUR="3">Heading 1</H1>
    <H2 ID="hdg2" CLASS="time" STYLE="color:red;" 
	TIMEACTION="style" BEGIN="0" DUR="3">Heading 2</H2>
    <H3 ID="hdg3" CLASS="time" STYLE="color:blue;" 
	TIMEACTION="style" BEGIN="3" DUR="3">Heading 3</H3>
    <H4 ID="hdg4" CLASS="time" STYLE="color:blue;" 
	TIMEACTION="style" BEGIN="3" DUR="3">Heading 4</H4>
    <H5 ID="hdg5" CLASS="time" STYLE="color:green;" 
	TIMEACTION="style" BEGIN="6" DUR="3">Heading 5</H5>
    <H6 ID="hdg6" CLASS="time" STYLE="color:green;" 
	TIMEACTION="style" BEGIN="6" DUR="3">Heading 6</H6>
</t:PAR>

Learn more about HTML+TIME in Column 67, Introduction to HTML+TIME.


People who read this tip also read these tips:

Look for similar tips by subject:


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Search Engine Optimization: Selecting and Embedding Keywords · Are Google's Language Translation Web Services Ready for Prime Time? · Installing and Using Meeplace, the Business Review CMS
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
IBM DB2 10 for z/OS: Justifying the Upgrade · Living La Vida Colo: Choosing the Right Colocation Facility · FTC Concerns over Social Media Privacy Linger