SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member lisamariexo's Avatar
    Join Date
    Aug 2012
    Location
    England
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Creating a Flash Animation using HMTL5?

    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

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,313
    Mentioned
    178 Post(s)
    Tagged
    9 Thread(s)
    Hi there,

    The first thing that comes to mind is this:

    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 can position the images on top of each other with CSS, then set the opacity accordingly.
    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.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •