SMIL in Parallel
<par> 元素中的對象將同時顯示(并行地)。
并行元素 <par>
<par> 元素?fù)碛性S多屬性。最常用的屬性有:
| 屬性 | 值 | 描述 |
|---|---|---|
| begin | time | 設(shè)置元素顯示之前的延遲。 |
| dur | time | 設(shè)置顯示的持續(xù)時間。 |
| endsync | "first"|"last"|id(clip) | 同步元素的停止。 |
| repeatCount | number | 設(shè)置顯示的重復(fù)次數(shù)。 |
如需完整的 SMIL 元素和屬性列表,請訪問 W3School SMIL 參考手冊。
同步(Synchronization )
通過在 <par> 標(biāo)簽中使用 endsync 屬性,片段的并行組能夠在同時停止。
endsync="first" 會在最短的片段結(jié)束時停止所有 <par> 組中的片段,無論其它片段的時間參數(shù)被如何設(shè)置。
endsync="last" 會在所有片段均結(jié)束播放時終止 <par> 組。這是默認(rèn)的。
endsync="id(ID)" 會在被標(biāo)示 (ID) 的片段結(jié)束時終止 <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>