标题:SMIL第3课:SMIL In HTML
作者:网友
日期:2020-11-26 19:41:44
内容:
Internet Explorer 能够在 HTML 文件中运行 SMIL 呈现。
在 IE 中运行 SMIL 呈现
通过 Internet Explorer 5.5 或更高的版本,能够将 SMIL 元素插入 HTML 文件中。
通过这种方式,任何 SMIL 呈现都能作为标准的 HTML 文件运行在因特网上。
添加引用
如需在 HTML 中使用 SMIL 元素,您必须为 Internet Explorer 定义一个 "time" 命名空间,这样才能识别这些元素。请这样做:
向 <html> 标签添加命名空间定义
添加一个 <?import> 元素,以导入 "time" 命名空间
如需向标准的 HTML 元素添加 SMIL 属性,您必须为 Internet Explorer 定义 "time" 类,这样才能识别这些属性。请这样做:
添加一个定义 "time" 类的 <style> 元素
<html xmlns:time="urn:schemas-microsoft-com:time"> <head> <?import namespace="time" implementation="#default#time2"> <style>.time {behavior: url(#default#time2)}</style> </head> |
<time:seq repeatCount="indefinite"> <img class="time" src="image1.jpg" dur="3s" /> <img class="time" src="image2.jpg" dur="3s" /> </time:seq> |
<html xmlns:time="urn:schemas-microsoft-com:time"> <head> <?import namespace="time" implementation="#default#time2"> <style>.time {behavior: url(#default#time2)}</style> </head> <body> <time:seq repeatCount="indefinite"> <img class="time" src="image1.jpg" dur="3s" /> <img class="time" src="image2.jpg" dur="3s" /> </time:seq> </body> </html> |