Hello, i am trying to create something that will be able to layer several images one by one in intervals,
but i want to avoid using a flash animation, is there a way i could do this using HTML5?
Thanks in advance
| SitePoint Sponsor |
Hello, i am trying to create something that will be able to layer several images one by one in intervals,
but i want to avoid using a flash animation, is there a way i could do this using HTML5?
Thanks in advance

Hi there,
The first thing that comes to mind is this:
You can position the images on top of each other with CSS, then set the opacity accordingly.HTML Code:<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Layering images</title> <style> img{ position:absolute; top: 0px; left: 0px; } #imgb{ opacity:0.5; } </style> </head> <body> <img id="imga" src="IMG_1.jpg"/> <img id="imgb" src="IMG_2.jpg"/> </body> </html>
You could then use JavaScript to add a new image every few seconds or so.
Is this the sort of thing that you had in mind?
If it is and you need a hand with the JS, just let me know.
How well do you know your JavaScript from your jQuery?
Check out SitePoint's latest JavaScript challenge
My blog
Bookmarks