spacer
Yehuda Shiran September 16, 2000
HTML+TIME's Beginning and Ending Times
Tips: September 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

You must specify when the HTML element should appear and for how long. You accomplish it by the BEGIN and END element attributes. You can specify the duration of the element with respect to its beginning time, instead of the ending time. You accomplish it by the DUR attribute. BEGIN, END, and DUR have intuitive defaults. If you don't set the BEGIN attribute, an element will begin displaying when the page loads. If you don't specify the END or DUR attributes, it will remains displayed indefinitely.

The following example shows a slide presentation in which each slide appears and disappears on a predefined schedule. Try it. We first specify the time2 default behavior as mytime CLASS:

<STYLE>
  .mytime {behavior: url(#default#time2);}
</STYLE>

The body of the page includes four IMG elements, one for every slide of the presentation. For the first slide, we define only the duration attribute. It will start displaying as soon as the page loads:

<IMG CLASS="mytime" SRC="slide1.gif" DUR="7">

We specify HTML+TIME attributes in seconds. The second slide is designated to begin after 2 seconds, the third slide after 4 seconds, and the fourth slide after 6 seconds. All slides are due to disappear after 7 seconds. Here are the last three slides:

<IMG CLASS="mytime" SRC="slide4.gif" BEGIN="2" DUR="7"><BR>
<IMG CLASS="mytime" SRC="slide5.gif" BEGIN="4" DUR="7">
<IMG CLASS="mytime" SRC="slide6.gif" BEGIN="6" DUR="7">

We use here the time2 behavior. Therefore, you need Internet Explorer 5.5 to display it. It is also the reason why we did not use the "t:" prefix on the HTML+TIME attributes. Had we used the time behavior (instead of time2), we would have had to use t:BEGIN and t:DUR instead of BEGIN and END, respectively. Here is the full listing of this example:

<HTML>
<HEAD>
<TITLE>Simple HTML+TIME Example>/TITLE>
<STYLE>
  .mytime {behavior: url(#default#time2);}
</STYLE>
</HEAD>
<BODY>
<IMG CLASS="mytime" SRC="slide1.gif" DUR="7">
<IMG CLASS="mytime" SRC="slide4.gif" BEGIN="2" DUR="7"><BR>
<IMG CLASS="mytime" SRC="slide5.gif" BEGIN="4" DUR="7">
<IMG CLASS="mytime" SRC="slide6.gif" BEGIN="6" DUR="7">
</BODY>
</HTML>

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