SMIL in HTML
- Vorige Pagina SMIL Bestand
- Volgende Pagina SMIL XHTML
Internet Explorer can run SMIL presentations in HTML files.
Run SMIL presentations in IE
With Internet Explorer 5.5 or higher versions, you can insert SMIL elements into HTML files.
In this way, any SMIL presentation can run as a standard HTML file on the Internet.
Add a reference
To use SMIL elements in HTML, you must define a "time" namespace for Internet Explorer so that it can recognize these elements. Do this:
- Add a namespace definition to the <html> tag
- Add an <?import> element to import the "time" namespace
To add SMIL attributes to standard HTML elements, you must define a "time" class for Internet Explorer so that it can recognize these attributes. Do this:
- Add a <style> element to define the "time" class
<html xmlns:time="urn:schemas-microsoft-com:time"> <head> <?import namespace="time" implementation="#default#time2"> <style>.time {behavior: url(#default#time2)}</style> </head>
In the next section, you can see a complete running example.
Add SMIL Element
Om SMIL-weergave in HTML uit te voeren, voeg dan een voorvoegsel en een class-eigenschap toe aan de SMIL-elementen:
<time:seq repeatCount="indefinite"> <img class="time" src="image1.jpg" dur="3s" /> <img class="time" src="image2.jpg" dur="3s" /> </time:seq>
In het bovenstaande voorbeeld hebben we de class="time" toegevoegd aan het <img>-element en hebben we een "time" voorvoegsel toegevoegd aan de SMIL-elementen.
Tip:Klassen en Namensruimtes hoeven niet altijd "time" te heten. Elk naam is toegestaan.
Een Internet Explorer Voorbeeld
<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>
- Vorige Pagina SMIL Bestand
- Volgende Pagina SMIL XHTML