HBCMS更多的中文手册参考:

How to Create An Animated Presentation Using HTML+TIME Transitions

DHTML文档教程

This tutorial shows you how to use HTML+TIME (Timed Interactive Multimedia Extensions) transitions to make an animated presentation. This presentation consists of several elements transitioning in and out of view. This is an example of using HTML+TIME transitions to coordinate the transitioning of several elements with one another. No scripting is used. Click the following Show Me button to see the presentation that will be created in this tutorial.

This feature requires Microsoft?Internet Explorer 6 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

one of the greatest advantages of using html+time transitions for an application like the preceding is the simplicity of the code. by working through this tutorial, you can discover some basic techniques that enable you to create your own presentations using html+time transitions.

prerequisites

this article assumes you know how to use introduction to dhtml behaviors, specifically, the time2 behavior of html+time. this article does not go into great detail on how to add a behavior to your page nor does it cover how to declare a namespace and use custom tags, as required by the time2 behavior. these topics are covered in the html+time overview and spice up your web pages with html+time. you should have some understanding of html+time transitions; for an overview, see using html+time transitions.

a quick look at the code

to start, have a quick look at the code of the entire sample. later on, this code is explained in greater detail, but for now, it might be useful to have a preview of what is needed to make the tutorial sample.

<HTML xmlns:t = "urn:schemas-microsoft-com:time">
<HEAD>
<STYLE>
.time    {behavior: url(#default#time2);}
.caption
{
font-size:large;
width:300px;
margin-top:20;
margin-bottom:15;
color:gold;
font-weight:bold;
background:#3366CC
}
.showOff
{
width:180px;
height:160px;
padding:10;
background-color:white;
font-size:small;
color:blue;
border-width:3px;
border-style:solid;
border-color:gold;
}
#oContainer
{
background:#3366CC;
border:6px ridge #FFCC99;
padding:10px;
font-family:arial;
color:white;
font-size:x-large;
width:500px;
height:450px;
text-align:center;
}
#oSpan1 {color:gold; width:30px; font-weight:bold; font-size:52pt; background:#3366CC}
#oSpan2 {font-size:large;width:450px; background:#3366CC}
#oSpan3 {text-align:center;color:white;font-size:large;width:450px; background:#3366CC}
</STYLE>
<?import namespace = t urn = "urn:schemas-microsoft-com:time"
implementation = "#default#time2" />
</HEAD>
<BODY>
<!-- The oContainer DIV contains all of the content. -->
<DIV ID="oContainer" CLASS="time" DUR="29">
<t:TRANSITIONFILTER ID="oContainerTranIn" MODE="in" BEGIN="oContainer.begin" TYPE="ellipseWipe" DUR="1"/>
<t:TRANSITIONFILTER MODE="out" BEGIN="oContainer.end - 2" TYPE="barnDoorWipe" DUR="2"/>
<!-- When the container DIV transitions out, all of the child elements
transition out with it. -->
Introducing HTML+TIME<BR>
<!-- The transitioning elements appear in the order they appear on the time
line. This SPAN is the first thing to transition in.  -->
<SPAN  ID="oSpan1" BEGIN="oContainerTranIn.end + 1" CLASS="time"  DUR="indefinite">
<t:TRANSITIONFILTER MODE="in" BEGIN="oSpan1.begin" TYPE="barWipe" DUR="2" />
Transitions
</SPAN>
<P><P>
<!-- Next, this SPAN fades in and then fades out -->
<SPAN  ID="oSpan2" BEGIN="oSpan1.begin+3" TIMEACTION="display" CLASS="time" DUR="4">
<t:TRANSITIONFILTER MODE="in" BEGIN="oSpan2.begin" TYPE="fade" DUR="2"  />
<t:TRANSITIONFILTER ID="oSpan2TranOut" MODE="out" BEGIN="oSpan2.end - 1" TYPE="fade" DUR="1"/>
A Fast and Simple way to add visual transitions to your media elements.
</SPAN>
<!-- This SPAN transitions into the same area that oSpan2 was. -->
<SPAN ID="oSpan3" BEGIN="oSpan2TranOut.end" CLASS="time" DUR="indefinite">
<t:TRANSITIONFILTER ID="oSpan2Tran" MODE="in" BEGIN="oSpan3.begin" TYPE="pushWipe" DUR="2" />
All Types of Media Can Be Transitioned Using HTML+TIME Transitions
</SPAN>
<!-- This is the caption to appear over the image. -->
<DIV TIMEACTION="display" CLASS="caption time" DUR="8" ID="oCaption1"
BEGIN="oSpan2Tran.end+1">
<t:TRANSITIONFILTER ID="oCaption1TranIn" MODE="in" BEGIN="oCaption1.begin" TYPE="fade" DUR="2" />
<t:TRANSITIONFILTER MODE="out" BEGIN="oCaption1.end - 2" TYPE="fade" DUR="2" />
Images
</DIV>
<!-- This is the image. It begins at the same time as the caption above it.-->
<t:IMG TIMEACTION="display" CLASS="showOff" DUR="indefinite" ID="oImage" SRC="../common/samples/author/behaviors/media/ART_fruit_2.gif"
BEGIN="oCaption1TranIn.end" END="oCaption1.end">
<t:TRANSITIONFILTER MODE="in" BEGIN="oImage.begin" TYPE="clockWipe" DUR="2" />
<t:TRANSITIONFILTER MODE="out" BEGIN="oImage.end - 2" TYPE="clockWipe" DUR="2" />
</t:img>
<!-- This is the caption to appear over a DIV -->
<DIV timeAction="display" CLASS="caption time" DUR="indefinite" ID="oCaption2"
BEGIN="oCaption1.end + .5">
<t:TRANSITIONFILTER MODE="in" BEGIN="oCaption2.begin" TYPE="fade" DUR="2" />
And More...
</DIV>
<!-- This is the last DIV to transition in. -->
<DIV TIMEACTION="display" CLASS="time showOff" DUR="indefinite" ID="oDiv"
begin="oCaption2.begin + 2">
<t:TRANSITIONFILTER MODE="in" BEGIN="oDiv.begin" TYPE="ellipseWipe" DUR="2" />
<button>Renderable Elements</button>
</DIV>
</DIV>
</BODY>
</HTML>
This feature requires Microsoft?Internet Explorer 6 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

much of the preceding code is inside of the style block. this code is important for this sample to render correctly; it is stored away from the functional elements for clarity. the rest of the code is mostly a collection of div and style elements contained inside one div. many of these elements have t:TRANSITIONFILTER elements applied to them. These elements and their corresponding t:TRANSITIONFILTER elements are timed to transition the elements in and out of view one after the other, giving an appearance of a presentation. Notice that no scripting is involved. This tutorial walks through each of the following steps to create the sample.

  1. Write the miscellaneous code needed for the sample to work properly.
    • Write the code that is needed to instantiate the HTML+TIME behavior.
    • Write the formatting code that will be needed by the menu in a STYLE tag.
  2. Build the presentation step by step by demonstrating and discussing the code needed for each transition that occurs on the individual time elements.

Setting the Stage

To use HTML+TIME elements and use the time2 behavior, the following code is needed.

<HTML XMLNS:t = "urn:schemas-microsoft-com:time">
<HEAD>
<STYLE>
.time    {behavior: url(#default#time2);}
</STYLE>
<?import namespace = t urn = "urn:schemas-microsoft-com:time"
implementation = "#default#time2" />
</HEAD>
<BODY>
.
.
.
</BODY>
</HTML>

For more information about creating an XML namespace and referencing the time2 behavior, see authoring html+time.

next, add the formatting code inside of the style tags. all of the elements in this sample derive their formatting from here. by separating formatting code from rendered elements, the functional code is simplified.

<STYLE>
.time    {behavior: url(#default#time2);}
.caption
{
font-size:large;
width:300px;
margin-top:20;
margin-bottom:15;
color:gold;
font-weight:bold;
background:#3366CC
}
.showOff
{
width:180px;
height:160px;
padding:10;
background-color:white;
font-size:small;
color:blue;
border-width:3px;
border-style:solid;
border-color:gold;
}
#oContainer
{
background:#3366CC;
border:6px ridge #FFCC99;
padding:10px;
font-family:arial;
color:white;
font-size:x-large;
width:500px;
height:450px;
text-align:center;
}
#oSpan1 {color:gold; width:30px; font-weight:bold; font-size:52pt; background:#3366CC}
#oSpan2 {font-size:large;width:450px; background:#3366CC}
#oSpan3 {text-align:center;color:white;font-size:large;width:450px; background:#3366CC}
</STYLE>

Step-by-Step Transitions

Now I will walk you through each step of building this document. After each step, you can render the code and see the effect.

Make a Container DIV

This sample consists of a larger container DIV (looks like a green chalkboard) that is the background for the display. Inside of this container DIV are several inner timed elements with t:TRANSITIONFILTER elements applied to them that create the display. When the display is over, the container DIV transitions out and ends its active period. All of the inner elements transition out with their parent. Let's first make this container DIV.

<DIV ID="oContainer" CLASS="time" DUR="29">
</DIV>

The dur attribute is set to 29 seconds; this is the total duration of the presentation.

the div must have layout in order to have an html+time transition applied to it. this div gains layout by having its width and height specified from the upper style tag.

#oContainer
{
.
.
width:500px;
height:450;
.
.
}

All of the elements that are transitioned in this sample gain layout in this way. For more information about what is needed to gain layout, see what can be transitioned?.

to transition this element into view, we apply a t:transitionfilter to the div with a mode attribute value of in. note that the value of in did not have to be included because this is the default value. it is included merely for clarity.

<!-- The oContainer DIV contains all of the content. -->
<DIV ID="oContainer" CLASS="time" DUR="29">
<t:TRANSITIONFILTER ID="oContainerTranIn" MODE="in" BEGIN="oContainer.begin"
TYPE="ellipseWipe" DUR="1"/>
<!-- When the container DIV transitions out, all of the child elements
transition out with it. -->
</DIV>

Notice that the begin attribute for the t:transitionfilter directly specifies the beginning time of the element that the t:transitionfilter is applied to.

<!-- The oContainer DIV contains all of the content. -->
<DIV ID="oContainer" CLASS="time" DUR="29">
<t:TRANSITIONFILTER ID="oContainerTranIn" MODE="in" BEGIN="oContainer.begin"
TYPE="ellipseWipe" DUR="1"/>
<!-- When the container DIV transitions out, all of the child elements
transition out with it. -->
</DIV>

This is a clear and simple way to coordinate the beginning of a t:TRANSITIONFILTER to the beginning of the transition element that is being transitioned into view and is used throughout the sample.

To transition this element out of view, we apply a second t:TRANSITIONFILTER to the DIV with a MODE attribute value of out.

<!-- The oContainer DIV contains all of the content. -->
<DIV ID="oContainer" CLASS="time" DUR="29">
<t:TRANSITIONFILTER ID="oContainerTranIn" MODE="in" BEGIN="oContainer.begin"
TYPE="ellipseWipe" DUR="1"/>
<t:TRANSITIONFILTER MODE="out" BEGIN="oContainer.end - 2" TYPE="barnDoorWipe"
DUR="2"/>
<!-- When the container DIV transitions out, all of the child elements
transition out with it. -->
</DIV>

This t:TRANSITIONFILTER begins 2 seconds before the container ends.

BEGIN="oContainer.end - 2"

We do this because the duration for the t:TRANSITIONFILTER as specified by the DUR attribute is set to a value of two. This facilitates a complete transition out that ends exactly when the active period of the container DIV ends. By timing the elements this way, the transition out appears as a smooth transition from visible to invisible. This same type of timing is done on all of the elements that transition out of view in this sample.

Let's take a look at the sample so far.

Note  Code that corresponds to the last step in the tutorial is surrounded by comments in bold.
<HTML xmlns:t = "urn:schemas-microsoft-com:time">
<HEAD>
<STYLE>
.time    {behavior: url(#default#time2);}
.caption
{
font-size:large;
width:300px;
margin-top:20;
margin-bottom:15;
color:gold;
font-weight:bold;
background:#3366CC
}
.showOff
{
width:180px;
height:160px;
padding:10;
background-color:white;
font-size:small;
color:blue;
border-width:3px;
border-style:solid;
border-color:gold;
}
#oContainer
{
background:#3366CC;
border:6px ridge #FFCC99;
padding:10px;
font-family:arial;
color:white;
font-size:x-large;
width:500px;
height:450px;
text-align:center;
}
#oSpan1 {color:gold; width:30px; font-weight:bold; font-size:52pt; background:#3366CC}
#oSpan2 {font-size:large;width:450px; background:#3366CC}
#oSpan3 {text-align:center;color:white;font-size:large;width:450px; background:#3366CC}
</STYLE>
<?import namespace = t urn = "urn:schemas-microsoft-com:time"
implementation = "#default#time2" />
</HEAD>
<BODY>
<!-- Here is the code of the last step -->
<!-- The oContainer DIV contains all of the content. -->
<DIV ID="oContainer" CLASS="time" DUR="29">
<t:TRANSITIONFILTER ID="oContainerTranIn" MODE="in" BEGIN="oContainer.begin"
TYPE="ellipseWipe" DUR="1"/>
<t:TRANSITIONFILTER MODE="out" BEGIN="oContainer.end - 2" TYPE="barnDoorWipe"
DUR="2"/>
<!-- When the container DIV transitions out, all of the child elements
transition out with it. -->
</DIV>
<!-- End of the code of the last step -->
</BODY>
</HTML>
This feature requires Microsoft?Internet Explorer 6 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

make the heading text

next, add the elements inside of the container div that display initially.

Introducing HTML+TIME<BR>
<!-- The transitioning elements appear in the order they appear on the time
line. This SPAN is the first thing to transition in.  -->
<SPAN  ID="oSpan1" BEGIN="oContainerTranIn.end + 1" CLASS="time"
DUR="indefinite">
<t:TRANSITIONFILTER MODE="in" BEGIN="oSpan1.begin" TYPE="barWipe" DUR="2" />
Transitions
</SPAN>

The HTML code stays visible throughout the display so no t:TRANSITIONFILTER with a MODE value of out is needed. Notice that the BEGIN attribute for the t:TRANSITIONFILTER references the end of the t:TRANSITIONFILTER that transitions the previous element into view.

<DIV ID="oContainer" CLASS="time" DUR="29">
<t:TRANSITIONFILTER ID="oContainerTranIn" MODE="in" BEGIN="oContainer.begin"
TYPE="ellipseWipe" DUR="1"/>
<t:TRANSITIONFILTER MODE="out" BEGIN="oContainer.end - 2" TYPE="barnDoorWipe"
DUR="2"/>
Introducing HTML+TIME<BR>
<!-- The transitioning elements appear in the order they appear on the time
line. This SPAN is the first thing to transition in.  -->
<SPAN  ID="oSpan1" BEGIN="oContainerTranIn.end + 1" CLASS="time"
DUR="indefinite">
<t:TRANSITIONFILTER MODE="in" BEGIN="oSpan1.begin" TYPE="barWipe" DUR="2" />
Transitions
</SPAN>

This is a convenient way to time an element's begin time in relation to the active period of a t:TRANSITIONFILTER element, rather than just the active periods of rendered timed elements. In this case, the next element begins just as the previous element finishes transitioning into view.

Let's take a look at the sample after the step.

<HTML xmlns:t = "urn:schemas-microsoft-com:time">
<HEAD>
<STYLE>
.time    {behavior: url(#default#time2);}
.caption
{
font-size:large;
width:300px;
margin-top:20;
margin-bottom:15;
color:gold;
font-weight:bold;
background:#3366CC
}
.showOff
{
width:180px;
height:160px;
padding:10;
background-color:white;
font-size:small;
color:blue;
border-width:3px;
border-style:solid;
border-color:gold;
}
#oContainer
{
background:#3366CC;
border:6px ridge #FFCC99;
padding:10px;
font-family:arial;
color:white;
font-size:x-large;
width:500px;
height:450px;
text-align:center;
}
#oSpan1 {color:gold; width:30px; font-weight:bold; font-size:52pt; background:#3366CC}
#oSpan2 {font-size:large;width:450px; background:#3366CC}
#oSpan3 {text-align:center;color:white;font-size:large;width:450px; background:#3366CC}
</STYLE>
<?import namespace = t urn = "urn:schemas-microsoft-com:time"
implementation = "#default#time2" />
</HEAD>
<BODY>
<!-- The oContainer DIV contains all of the content. -->
<DIV ID="oContainer" CLASS="time" DUR="29">
<t:TRANSITIONFILTER ID="oContainerTranIn" MODE="in" BEGIN="oContainer.begin"
TYPE="ellipseWipe" DUR="1"/>
<t:TRANSITIONFILTER MODE="out" BEGIN="oContainer.end - 2" TYPE="barnDoorWipe"
DUR="2"/>
<!-- When the container DIV transitions out, all of the child elements
transition out with it. -->
<!-- Here is the code of the last step -->
Introducing HTML+TIME<BR>
<!-- The transitioning elements appear in the order they appear on the time
line. This SPAN is the first thing to transition in.  -->
<SPAN  ID="oSpan1" BEGIN="oContainerTranIn.end + 1" CLASS="time"
DUR="indefinite">
<t:TRANSITIONFILTER MODE="in" BEGIN="oSpan1.begin" TYPE="barWipe" DUR="2" />
Transitions
</SPAN>
<!-- End of the code of the last step -->
</DIV>
</BODY>
</HTML>
This feature requires Microsoft?Internet Explorer 6 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

make the ''a fast and simple way...'' span

next, a span with some text is displayed. the span displays only for a moment and then transitions out of view.

<P><P>
<!-- Next, this SPAN fades in and then fades out -->
<SPAN  ID="oSpan2" BEGIN="oSpan1.begin+3" TIMEACTION="display" CLASS="time"
DUR="4">
<t:TRANSITIONFILTER MODE="in" BEGIN="oSpan2.begin" TYPE="fade" DUR="2"/>
<t:TRANSITIONFILTER ID="oSpan2TranOut" MODE="out" BEGIN="oSpan2.end - 1"
TYPE="fade" DUR="1"/>
A Fast and Simple way to add visual transitions to your media elements.
</SPAN>

Let's take a look at the sample after the step.

<HTML xmlns:t = "urn:schemas-microsoft-com:time">
<HEAD>
<STYLE>
.time    {behavior: url(#default#time2);}
.caption
{
font-size:large;
width:300px;
margin-top:20;
margin-bottom:15;
color:gold;
font-weight:bold;
background:#3366CC
}
.showOff
{
width:180px;
height:160px;
padding:10;
background-color:white;
font-size:small;
color:blue;
border-width:3px;
border-style:solid;
border-color:gold;
}
#oContainer
{
background:#3366CC;
border:6px ridge #FFCC99;
padding:10px;
font-family:arial;
color:white;
font-size:x-large;
width:500px;
height:450px;
text-align:center;
}
#oSpan1 {color:gold; width:30px; font-weight:bold; font-size:52pt; background:#3366CC}
#oSpan2 {font-size:large;width:450px; background:#3366CC}
#oSpan3 {text-align:center;color:white;font-size:large;width:450px; background:#3366CC}
</STYLE>
<?import namespace = t urn = "urn:schemas-microsoft-com:time"
implementation = "#default#time2" />
</HEAD>
<BODY>
<!-- The oContainer DIV contains all of the content. -->
<DIV ID="oContainer" CLASS="time" DUR="29">
<t:TRANSITIONFILTER ID="oContainerTranIn" MODE="in" BEGIN="oContainer.begin"
TYPE="ellipseWipe" DUR="1"/>
<t:TRANSITIONFILTER MODE="out" BEGIN="oContainer.end - 2" TYPE="barnDoorWipe"
DUR="2"/>
<!-- When the container DIV transitions out, all of the child elements
transition out with it. -->
<DIV ALIGN="center">
Introducing HTML+TIME<BR>
<!-- The transitioning elements appear in the order they appear on the time
line. This SPAN is the first thing to transition in.  -->
<SPAN  ID="oSpan1" BEGIN="oContainerTranIn.end + 1" CLASS="time"
DUR="indefinite">
<t:TRANSITIONFILTER MODE="in" BEGIN="oSpan1.begin" TYPE="barWipe" DUR="2" />
Transitions
</SPAN>
<!-- Here is the code of the last step -->
<P><P>
<!-- Next, this SPAN fades in and then fades out -->
<SPAN  ID="oSpan2" BEGIN="oSpan1.begin+3" TIMEACTION="display" CLASS="time"
DUR="4">
<t:TRANSITIONFILTER MODE="in" BEGIN="oSpan2.begin" TYPE="fade" DUR="2"/>
<t:TRANSITIONFILTER ID="oSpan2TranOut" MODE="out" BEGIN="oSpan2.end - 1"
TYPE="fade" DUR="1"/>
A Fast and Simple way to add visual transitions to your media elements.
</SPAN>
<!-- End of the code of the last step -->
</DIV>
</BODY>
</HTML>
This feature requires Microsoft?Internet Explorer 6 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

make the ''all types of media...'' span

once the ospan2?a href="../objects/span.html">span transitions out, another span transitions into the same place as ospan2 was.

<!-- This SPAN transitions into the same area that oSpan2 was. -->
<SPAN ID="oSpan3" BEGIN="oSpan2TranOut.end" CLASS="time" DUR="indefinite">
<t:TRANSITIONFILTER ID="oSpan2Tran" MODE="in" BEGIN="oSpan3.begin"
TYPE="pushWipe" DUR="2" />
All Types of Media Can Be Transitioned Using HTML+TIME Transitions
</SPAN>

Let's take a look at the sample after the step.

<HTML xmlns:t = "urn:schemas-microsoft-com:time">
<HEAD>
<STYLE>
.time    {behavior: url(#default#time2);}
.caption
{
font-size:large;
width:300px;
margin-top:20;
margin-bottom:15;
color:gold;
font-weight:bold;
background:#3366CC
}
.showOff
{
width:180px;
height:160px;
padding:10;
background-color:white;
font-size:small;
color:blue;
border-width:3px;
border-style:solid;
border-color:gold;
}
#oContainer
{
background:#3366CC;
border:6px ridge #FFCC99;
padding:10px;
font-family:arial;
color:white;
font-size:x-large;
width:500px;
height:450px;
text-align:center;
}
#oSpan1 {color:gold; width:30px; font-weight:bold; font-size:52pt; background:#3366CC}
#oSpan2 {font-size:large;width:450px; background:#3366CC}
#oSpan3 {text-align:center;color:white;font-size:large;width:450px; background:#3366CC}
</STYLE>
<?import namespace = t urn = "urn:schemas-microsoft-com:time"
implementation = "#default#time2" />
</HEAD>
<BODY>
<!-- The oContainer DIV contains all of the content. -->
<DIV ID="oContainer" CLASS="time" DUR="29">
<t:TRANSITIONFILTER ID="oContainerTranIn" MODE="in" BEGIN="oContainer.begin"
TYPE="ellipseWipe" DUR="1"/>
<t:TRANSITIONFILTER MODE="out" BEGIN="oContainer.end - 2" TYPE="barnDoorWipe"
DUR="2"/>
<!-- When the container DIV transitions out, all of the child elements
transition out with it. -->
Introducing HTML+TIME<BR>
<!-- The transitioning elements appear in the order they appear on the time
line. This SPAN is the first thing to transition in.  -->
<SPAN  ID="oSpan1" BEGIN="oContainerTranIn.end + 1" CLASS="time"
DUR="indefinite">
<t:TRANSITIONFILTER MODE="in" BEGIN="oSpan1.begin" TYPE="barWipe" DUR="2" />
Transitions
</SPAN>
<P><P>
<!-- Next, this SPAN fades in and then fades out -->
<SPAN  ID="oSpan2" BEGIN="oSpan1.begin+3" TIMEACTION="display" CLASS="time"
DUR="4">
<t:TRANSITIONFILTER MODE="in" BEGIN="oSpan2.begin" TYPE="fade" DUR="2"/>
<t:TRANSITIONFILTER ID="oSpan2TranOut" MODE="out" BEGIN="oSpan2.end - 1"
TYPE="fade" DUR="1"/>
A Fast and Simple way to add visual transitions to your media elements.
</SPAN>
<!-- Here is the code of the last step -->
<!-- This SPAN transitions into the same area that oSpan2 was. -->
<SPAN ID="oSpan3" BEGIN="oSpan2TranOut.end" CLASS="time" DUR="indefinite">
<t:TRANSITIONFILTER ID="oSpan2Tran" MODE="in" BEGIN="oSpan3.begin" TYPE="pushWipe" DUR="2" />
All Types of Media Can Be Transitioned Using HTML+TIME Transitions
</SPAN>
<!-- End of the code of the last step  -->
</DIV>
</BODY>
</HTML>
This feature requires Microsoft?Internet Explorer 6 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

create the image and its caption

an image with a caption above it is displayed next. other elements appear in the same space as these elements, so these elements each have t:transitionfilter elements assigned to them to transition the elements out of view.

<!-- This is the caption to appear over the image. -->
<DIV TIMEACTION="display" CLASS="caption time" DUR="8" ID="oCaption1"
BEGIN="oSpan2Tran.end+1">
<t:TRANSITIONFILTER ID="oCaption1TranIn" MODE="in" BEGIN="oCaption1.begin"
TYPE="fade" DUR="2" />
<t:TRANSITIONFILTER MODE="out" BEGIN="oCaption1.end - 2" TYPE="fade" DUR="2"/>
Images
</DIV>
<!-- This is the image. It begins at the same time as the caption above
it. -->
<t:IMG TIMEACTION="display" CLASS="showOff" DUR="indefinite" ID="oImage" SRC="../common/samples/author/behaviors/media/ART_fruit_2.gif"
BEGIN="oCaption1TranIn.end" END="oCaption1.end">
<t:TRANSITIONFILTER MODE="in" BEGIN="oImage.begin" TYPE="clockWipe" DUR="2"/>
<t:TRANSITIONFILTER MODE="out" BEGIN="oImage.end - 2" TYPE="clockWipe" DUR="2"/>
</t:img>

Let's take a look at the sample after the step.

<HTML xmlns:t = "urn:schemas-microsoft-com:time">
<HEAD>
<STYLE>
.time    {behavior: url(#default#time2);}
.caption
{
font-size:large;
width:300px;
margin-top:20;
margin-bottom:15;
color:gold;
font-weight:bold;
background:#3366CC
}
.showOff
{
width:180px;
height:160px;
padding:10;
background-color:white;
font-size:small;
color:blue;
border-width:3px;
border-style:solid;
border-color:gold;
}
#oContainer
{
background:#3366CC;
border:6px ridge #FFCC99;
padding:10px;
font-family:arial;
color:white;
font-size:x-large;
width:500px;
height:450px;
text-align:center;
}
#oSpan1 {color:gold; width:30px; font-weight:bold; font-size:52pt; background:#3366CC}
#oSpan2 {font-size:large;width:450px; background:#3366CC}
#oSpan3 {text-align:center;color:white;font-size:large;width:450px; background:#3366CC}
</STYLE>
<?import namespace = t urn = "urn:schemas-microsoft-com:time"
implementation = "#default#time2" />
</HEAD>
<BODY>
<!-- The oContainer DIV contains all of the content. -->
<DIV ID="oContainer" CLASS="time" DUR="29">
<t:TRANSITIONFILTER ID="oContainerTranIn" MODE="in" BEGIN="oContainer.begin"
TYPE="ellipseWipe" DUR="1"/>
<t:TRANSITIONFILTER MODE="out" BEGIN="oContainer.end - 2" TYPE="barnDoorWipe"
DUR="2"/>
<!-- When the container DIV transitions out, all of the child elements
transition out with it. -->
<CENTER>Introducing HTML+TIME<BR>
<!-- The transitioning elements appear in the order they appear on the time
line. This SPAN is the first thing to transition in.  -->
<SPAN  ID="oSpan1" BEGIN="oContainerTranIn.end + 1" CLASS="time"
DUR="indefinite">
<t:TRANSITIONFILTER MODE="in" BEGIN="oSpan1.begin" TYPE="barWipe" DUR="2" />
Transitions
</SPAN>
<P><P>
<!-- Next, this SPAN fades in and then fades out -->
<SPAN  ID="oSpan2" BEGIN="oSpan1.begin+3" TIMEACTION="display" CLASS="time"
DUR="4">
<t:TRANSITIONFILTER MODE="in" BEGIN="oSpan2.begin" TYPE="fade" DUR="2"/>
<t:TRANSITIONFILTER ID="oSpan2TranOut" MODE="out" BEGIN="oSpan2.end - 1"
TYPE="fade" DUR="1"/>
A Fast and Simple way to add visual transitions to your media elements.
</SPAN>
<!-- This SPAN transitions into the same area that oSpan2 was. -->
<SPAN ID="oSpan3" BEGIN="oSpan2TranOut.end" CLASS="time" DUR="indefinite">
<t:TRANSITIONFILTER ID="oSpan2Tran" MODE="in" BEGIN="oSpan3.begin"
TYPE="pushWipe" DUR="2" />
All Types of Media Can Be Transitioned Using HTML+TIME Transitions
</SPAN>
<!-- Here is the code of the last step -->
<!-- This is the caption to appear over the image. -->
<DIV TIMEACTION="display" CLASS="caption time" DUR="8" ID="oCaption1"
BEGIN="oSpan2Tran.end+1">
<t:TRANSITIONFILTER ID="oCaption1TranIn" MODE="in" BEGIN="oCaption1.begin"
TYPE="fade" DUR="2" />
<t:TRANSITIONFILTER MODE="out" BEGIN="oCaption1.end - 2" TYPE="fade" DUR="2"/>
Images
</DIV>
<!-- This is the image. It begins at the same time as the caption above
it. -->
<t:IMG TIMEACTION="display" CLASS="showOff" DUR="indefinite" ID="oImage" SRC="../common/samples/author/behaviors/media/ART_fruit_2.gif"
BEGIN="oCaption1TranIn.end" END="oCaption1.end">
<t:TRANSITIONFILTER MODE="in" BEGIN="oImage.begin" TYPE="clockWipe" DUR="2"/>
<t:TRANSITIONFILTER MODE="out" BEGIN="oImage.end - 2" TYPE="clockWipe" DUR="2"/>
</t:img>
<!-- End of the code of the last step -->
</DIV>
</BODY>
</HTML>
This feature requires Microsoft?Internet Explorer 6 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

create the display div with its caption

a display div with a caption over it transitions into the same place as the last elements. shortly after these elements transition in, the container div transitions out and ends its time line. naturally, all inner elements still visible transition out with their parent.

<!-- This is the caption to appear over a DIV -->
<DIV timeAction="display" CLASS="caption time" DUR="indefinite" ID="oCaption2"
BEGIN="oCaption1.end + .5">
<t:TRANSITIONFILTER MODE="in" BEGIN="oCaption2.begin" TYPE="fade" DUR="2"/>
And More...
</DIV>
<!-- This is the last DIV to transition in. -->
<DIV TIMEACTION="display" CLASS="time showOff" DUR="indefinite" ID="oDiv"
begin="oCaption2.begin + 2" />
<t:TRANSITIONFILTER MODE="in" BEGIN="oDiv.begin" TYPE="ellipseWipe" DUR="2"/>
Renderable Elements
</DIV>
</CENTER>

Let's take a look at the completed sample.

<HTML xmlns:t = "urn:schemas-microsoft-com:time">
<HEAD>
<HTML xmlns:t = "urn:schemas-microsoft-com:time">
<HEAD>
<STYLE>
.time    {behavior: url(#default#time2);}
.caption
{
font-size:large;
width:300px;
margin-top:20;
margin-bottom:15;
color:gold;
font-weight:bold;
background:#3366CC
}
.showOff
{
width:180px;
height:160px;
padding:10;
background-color:white;
font-size:small;
color:blue;
border-width:3px;
border-style:solid;
border-color:gold;
}
#oContainer
{
background:#3366CC;
border:6px ridge #FFCC99;
padding:10px;
font-family:arial;
color:white;
font-size:x-large;
width:500px;
height:450px;
text-align:center;
}
#oSpan1 {color:gold; width:30px; font-weight:bold; font-size:52pt; background:#3366CC}
#oSpan2 {font-size:large;width:450px; background:#3366CC}
#oSpan3 {text-align:center;color:white;font-size:large;width:450px; background:#3366CC}
</STYLE>
<?import namespace = t urn = "urn:schemas-microsoft-com:time"
implementation = "#default#time2" />
</HEAD>
<BODY>
<!-- The oContainer DIV contains all of the content. -->
<DIV ID="oContainer" CLASS="time" DUR="29">
<t:TRANSITIONFILTER ID="oContainerTranIn" MODE="in" BEGIN="oContainer.begin"
TYPE="ellipseWipe" DUR="1"/>
<t:TRANSITIONFILTER MODE="out" BEGIN="oContainer.end - 2" TYPE="barnDoorWipe"
DUR="2"/>
<!-- When the container DIV transitions out, all of the child elements
transition out with it. -->
Introducing HTML+TIME<BR>
<!-- The transitioning elements appear in the order they appear on the time
line. This SPAN is the first thing to transition in.  -->
<SPAN  ID="oSpan1" BEGIN="oContainerTranIn.end + 1" CLASS="time"
DUR="indefinite">
<t:TRANSITIONFILTER MODE="in" BEGIN="oSpan1.begin" TYPE="barWipe" DUR="2" />
Transitions
</SPAN>
<P><P>
<!-- Next, this SPAN fades in and then fades out -->
<SPAN  ID="oSpan2" BEGIN="oSpan1.begin+3" TIMEACTION="display" CLASS="time"
DUR="4">
<t:TRANSITIONFILTER MODE="in" BEGIN="oSpan2.begin" TYPE="fade" DUR="2"/>
<t:TRANSITIONFILTER ID="oSpan2TranOut" MODE="out" BEGIN="oSpan2.end - 1"
TYPE="fade" DUR="1"/>
A Fast and Simple way to add visual transitions to your media elements.
</SPAN>
<!-- This SPAN transitions into the same area that oSpan2 was. -->
<SPAN ID="oSpan3" BEGIN="oSpan2TranOut.end" CLASS="time" DUR="indefinite">
<t:TRANSITIONFILTER ID="oSpan2Tran" MODE="in" BEGIN="oSpan3.begin"
TYPE="pushWipe" DUR="2" />
All Types of Media Can Be Transitioned Using HTML+TIME Transitions
</SPAN>
<!-- This is the caption to appear over the image. -->
<DIV TIMEACTION="display" CLASS="caption time" DUR="8" ID="oCaption1"
BEGIN="oSpan2Tran.end+1">
<t:TRANSITIONFILTER ID="oCaption1TranIn" MODE="in" BEGIN="oCaption1.begin"
TYPE="fade" DUR="2" />
<t:TRANSITIONFILTER MODE="out" BEGIN="oCaption1.end - 2" TYPE="fade" DUR="2"/>
Images
</DIV>
<!-- This is the image. It begins at the same time as the caption above
it. -->
<t:IMG TIMEACTION="display" CLASS="showOff" DUR="indefinite" ID="oImage" SRC="../common/samples/author/behaviors/media/ART_fruit_2.gif"
BEGIN="oCaption1TranIn.end" END="oCaption1.end">
<t:TRANSITIONFILTER MODE="in" BEGIN="oImage.begin" TYPE="clockWipe" DUR="2"/>
<t:TRANSITIONFILTER MODE="out" BEGIN="oImage.end - 2" TYPE="clockWipe" DUR="2"/>
</t:img>
<!-- Here is the code of the last step -->
<!-- This is the caption to appear over a DIV -->
<DIV timeAction="display" CLASS="caption time" DUR="indefinite" ID="oCaption2"
BEGIN="oCaption1.end + .5">
<t:TRANSITIONFILTER MODE="in" BEGIN="oCaption2.begin" TYPE="fade" DUR="2"/>
And More...
</DIV>
<!-- This is the last DIV to transition in. -->
<DIV TIMEACTION="display" CLASS="time showOff" DUR="indefinite" ID="oDiv"
begin="oCaption2.begin + 2">
<t:TRANSITIONFILTER MODE="in" BEGIN="oDiv.begin" TYPE="ellipseWipe" DUR="2" />
<button>Renderable Elements</button>
</DIV>
<!-- End of the code of the last step -->
</DIV>
</BODY>
</HTML>
This feature requires Microsoft?Internet Explorer 6 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

notes about this sample

there are two important notes to make about this sample.

first, as already mentioned, all the elements of this sample gain their layout by having their widths and/or heights specified. alternatively, these elements could have had layout by giving their position property a value of absolute or relative. doing this can be a convenient way to position elements exactly where you want them. however, there is a trade-off by doing this. positioning elements in this way takes them out of the flow of the document, and these elements no longer transition with their parent elements. for this sample, this would mean that each inner positioned element would have to be transitioned out independently of the parent. rather than have these extra transition elements, this sample used other formatting attributes and elements to provide proper positioning such as margins, padding, p tags, and so forth.

secondly, you may have noticed the following attribute in some of the elements.

TIMEACTION="display"

The timeaction property determines what action is taken on the element while the time line is active. this attribute was included in elements that transitioned out of view and would have another element transition into the same area. a value of display specifies that as the element changes between active and inactive states, the surrounding html elements dynamically reflow within the page. without this, the new element would render as though the inactive element were still there and would not transition into the same area.

related topics