SMIL in Parallel

<par> 元素中的對象將同時顯示(并行地)。

并行元素 <par>

<par> 元素擁有許多屬性。最常用的屬性有:

屬性 描述
begin time 設置元素顯示之前的延遲。
dur time 設置顯示的持續時間。
endsync "first"|"last"|id(clip) 同步元素的停止。
repeatCount number 設置顯示的重復次數。

如需完整的 SMIL 元素和屬性列表,請訪問 CodeW3C.com SMIL 參考手冊

同步(Synchronization )

通過在 <par> 標簽中使用 endsync 屬性,片段的并行組能夠在同時停止。

endsync="first" 會在最短的片段結束時停止所有 <par> 組中的片段,無論其它片段的時間參數被如何設置。

endsync="last" 會在所有片段均結束播放時終止 <par> 組。這是默認的。

endsync="id(ID)" 會在被標示 (ID) 的片段結束時終止 <par> 組。該 ID 將引用該片段的 id 屬性的值。

實例:同時顯示

<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>

TIY