SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jul 2003
    Location
    Nantucket
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Rotating Image Script

    Hey everyone,

    I was wondering if anyone could point me in the right direction for a particular script. I have a page with 3 images on it. I want to make these images rotate upon a screen refresh with 3 new images each time. I have close to 50 images that I want to be able to dynamically and randomly generate each time a user comes to the site. Any ideas would be greatly appreciated.

    Thanks

  2. #2
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ya. This is a simple script, so I'd like to help you make it, if you feel up to it. Here are the rough steps

    1) Create an array with all the image names/paths.
    2) Generate three random numbers, ranged within the size of the array
    3) Pull those 3 image paths, and create image objects from them
    4) Create and add an image element, or use an existing image element
    5) Rotate through your 3 images, changing the src of the img element at a set increment.

    Whaddya think?
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  3. #3
    SitePoint Member
    Join Date
    Jul 2003
    Location
    Nantucket
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the idea/direction. Looks like I need to spruce up my java skills and/or break out my java books from college. If you have any scripts that are similar to what you are talking about, but need to be tweaked to my particular scenario that would help. Thanks again for your suggestion.

  4. #4

  5. #5
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I have an existing slideshow script, which would handle steps 3-5 from above. Think you can manage 1 & 2?
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev





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
  •