SMIL Sequence
<seq> - 最常用的 SMIL 元素 - 定義序列。
序列元素 <seq>
<seq> 元素可定義序列。<seq> 元素中的子元素依次顯示在序列中。
您可以使用 <seq> 元素來(lái)定義要顯示的圖像列表、段落列表、視頻列表,或任何其他的元素。
<seq> 元素?fù)碛性S多屬性,最常用的屬性有:
| 屬性 | 值 | 描述 |
|---|---|---|
| begin | time | 在元素被顯示之前的延遲。 |
| dur | time | 設(shè)置顯示的持續(xù)時(shí)間。 |
| repeatCount | number | 設(shè)置顯示的重復(fù)次數(shù)。 |
如需完整的 SMIL 元素和屬性列表,請(qǐng)?jiān)L問 W3School SMIL 參考手冊(cè)。
實(shí)例:顯示圖像序列
<html xmlns:t="urn:schemas-microsoft-com:time">
<head>
<?import namespace="t" implementation="#default#time2">
<style>.t {behavior: url(#default#time2)}</style>
</head>
<body>
<t:seq repeatCount="indefinite">
<img class="t" src="image1.jpg" dur="1s" />
<img class="t" src="image2.jpg" dur="1s" />
</t:seq>
</body>
</html>
實(shí)例:顯示文本序列
<html xmlns:t="urn:schemas-microsoft-com:time">
<head>
<?import namespace="t" implementation="#default#time2">
<style>.t {behavior: url(#default#time2)}</style>
</head>
<body>
<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>
<h2 class="t" dur="3s">
I will display for three seconds</h2>
</t:seq>
</body>
</html>