W3Schools

home HOME

SMIL Tutorial

SMIL HOME
SMIL Intro
SMIL Files
SMIL HTML
SMIL XHTML
SMIL Timing
SMIL Sequence
SMIL Parallel
SMIL Transitions
SMIL Media
SMIL Reference

Selected Reading
Web Statistics
Web Glossary
Web Hosting
Web Quality

W3Schools Forum

Helping W3Schools

SMIL in Parallel

Previous Next

Objects inside the <par> element will be played at the same time (in parallel).


The Parallel Element <par>

The <par> element can have a number of attributes. The most common attributes are:

Attribute Value Description
begin time Sets the delay before the element is displayed
dur time Sets the duration for the display
endsync "first"|"last"|id(clip) Synchronizes the stopping of elements
repeatCount number Sets the number of repetitions for the display

For a full list of SMIL elements and attributes: W3Schools SMIL Reference.  


Synchronization

A parallel group of clips can be stopped at the same time using the endsync attribute in the <par> tag.

endsync="first" stops all the clips in the <par> group when the shortest clip are finished regardles of any time parameters set for the other clips.

endsync="last" concludes the <par> group when all clips have finished playing. This is the default.

endsync="id(ID)" concludes the <par> group when the clip with the identified (ID) clip are finished. The ID is referring to the value of the clips id attribute.


Example: Displaying Things Simultaneously

<html xmlns:t="urn:schemas-microsoft-com:time">
<head>
  <?import namespace="t" implementation="#default#time2">
  <style>.t {behavior: url(#default#time2)}</style>
</head>
<body>
<par>
<t:audio
src="liar.wav"
repeatCount="indefinite"
type="wav" />
<t:seq repeatCount="indefinite">
  <h2 class="t" dur="1s">
  I will display for one second</h2>
  <h2 class="t" dur="2s">
  I will display for two seconds</h2>
</t:seq>
</par>
</body>
</html>

Click here to try it yourself.


Previous Next


Want To Be A Web Master?

If you want to be a Web Master, you will have to host your web site with an ISP (Internet Service Provider).

MaximumASP offers seven different configurations of dedicated servers to meet your Windows and .NET hosting needs. Hosted on our multi-tiered Enterprise Class network, these servers provide the performance, security and reliability you need to host your high end web sites and applications.

Visit MaximumASP




Jump to: Top of Page or HOME or Printer Friendly Printer friendly page

W3Schools provides material for training only. We do not warrant the correctness of its contents. The risk from using it lies entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy.

Copyright 1999-2008 by Refsnes Data. All Rights Reserved.

Validate Validate W3C-WAI level A conformance icon W3Schools was converted to XHTML in December 1999