SMIL Transition
- Previous Page SMIL Parallel
- Next Page SMIL Media
Transition 能够为元素生成“淡入淡出”以及“擦除”等效果。
Transition 属于 SMIL 2.0
Transition 是 SMIL 2.0 中的新特性。Transition 不属于 SMIL 1.0 规范的组成部分。
Internet Explorer 6 支持基于 SMIL 2.0 规范的 Transition。Transition 由 <transitionfilter> 元素实现。
属性
<transitionfilter> 元素拥有若干元素,最常用的有:
属性 | 描述 | 例子 |
---|---|---|
type | 定义 transition 滤镜的类型(参阅 transition 滤镜列表) | type="clockWipe" |
begin | 定义何时开始 transition | begin="0s" |
mode | 定义 transition 模式 | mode="in" |
from | 定义 transition 的开始值 | from="0.2" |
to | 定义 transition 的结束值 | to="0.8" |
Transition 滤镜
可使用下面的 transition 滤镜:
fade, barnDoorWipe, barWipe, clockWipe, ellipseWipe, fanWipe, irisWipe pushWipe, slideWipe, snakeWipe, spiralWipe, starWipe
Example: Display Transition
<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:transitionfilter targetelement="keyb" type="clockWipe" begin="keyb.begin" dur="2s" /> <img id="keyb" class="t" src="pic_keyb.jpg" dur="4s" width="128" height="107" /> </body> </html>
In the example above, the image will be displayed for 4 seconds. The Transition filter will display the image in 'clockWipe' style for 2 seconds.
Hint:You must run Internet Explorer 6 to display this example.
- Previous Page SMIL Parallel
- Next Page SMIL Media