SMIL Sequence
- 上一頁 SMIL Timing
- 下一頁 SMIL Parallel
<seq> - 最常用的 SMIL 元素 - 定義序列。
序列元素 <seq>
<seq> 元素可定義序列。<seq> 元素中的子元素依次顯示在序列中。
您可以使用 <seq> 元素來定義要顯示的圖像列表、段落列表、視頻列表,或任何其他的元素。
<seq> 元素擁有許多屬性,最常用的屬性有:
屬性 | 值 | 描述 |
---|---|---|
begin | time | 在元素被顯示之前的延遲。 |
dur | time | 設置顯示的持續時間。 |
repeatCount | number | 設置顯示的重復次數。 |
如需完整的 SMIL 元素和屬性列表,請訪問 CodeW3C.com SMIL 參考手冊。
實例:顯示圖像序列
<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>
實例:顯示文本序列
<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>
- 上一頁 SMIL Timing
- 下一頁 SMIL Parallel