SMIL en HTML
- Página anterior Archivos SMIL
- Página siguiente SMIL XHTML
Internet Explorer puede ejecutar presentaciones SMIL en archivos HTML.
Ejecutar presentaciones SMIL en IE
A partir de Internet Explorer 5.5 o superior, es posible insertar elementos SMIL en archivos HTML.
De esta manera, cualquier presentación SMIL puede ejecutarse como un archivo HTML estándar en Internet.
Agregar una referencia
Para usar elementos SMIL en HTML, debe definir un espacio de nombres "time" para Internet Explorer, para que pueda identificar estos elementos. Haga lo siguiente:
- Agregar la definición de espacio de nombres a la etiqueta <html>
- Agregar un elemento <?import> para importar el espacio de nombres "time"
Para agregar atributos SMIL a elementos HTML estándar, debe definir una clase "time" para Internet Explorer, para que pueda identificar estos atributos. Haga lo siguiente:
- Agregar un elemento <style> que define la clase "time"
<html xmlns:time="urn:schemas-microsoft-com:time"> <head> <?import namespace="time" implementation="#default#time2"> <style>.time {behavior: url(#default#time2)}</style> </head>
En el siguiente párrafo, puede ver un ejemplo de ejecución completo.
Agregar elementos SMIL
Para ejecutar presentaciones SMIL en HTML, simplemente agregue un prefijo y una propiedad class a los elementos SMIL:
<time:seq repeatCount="indefinite"> <img class="time" src="image1.jpg" dur="3s" /> <img class="time" src="image2.jpg" dur="3s" /> </time:seq>
En el ejemplo anterior, hemos agregado la clase "time" al elemento <img> y el prefijo "time" a los elementos SMIL.
Consejo:Las clases y los espacios de nombres no necesitan llamarse necesariamente "time". Cualquier nombre puede ser.
Una instancia de Internet Explorer
<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>
- Página anterior Archivos SMIL
- Página siguiente SMIL XHTML