SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2006
    Location
    Chicago
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Red face Animation & Javascript

    I am creating an animation with 4 images that I would like to have the images to change every few seconds, but to do that I am looking for a Javascript that will run the images. I am putting this together this together using ImageReady CS2.

  2. #2
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use setTimeout() or setInterval() to execute a function every x milliseconds. Your function would merely change the .src property of an <img> tag. You will want to "preload" the images first so that the animation works smoothly the first time it runs.

    First learn how to do an "image rollover" with "preloaded" images. That is one of the first things people learn with js, and there are hundreds of tutorials.


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
  •