Results 1 to 3 of 3

Thread: Rotating Images In Puzzle

  1. #1
    Join Date
    Jan 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Rotating Images In Puzzle

    Is there a way to add code to the DHTML Puzzle to have it rotate images each week or each time played either from a list of images or from a group of images published in the same place?

    Clickety here for the script in question

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Assuming all of the images are of the same dimensions, this should do nicely. Use as many entries to the randomImages array as you like, the more entries, the less likely accidental repeats will be (additions/changes red):

    Code:
    /*
    DHTML puzzle script (By Davey Erwin, daverwin@hotmail.com, http://daverwin.homepage.com/)
    Modified slightly/ permission granted to Dynamic Drive to feature script in archive
    For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
    */
    
    randomImages=new Array()
    randomImages[0]='photo1.jpg'
    randomImages[1]='photo2.jpg'
    randomImages[2]='photo3.jpg'
    
    randomImages.sort(function() {return 0.5 - Math.random();})
    
    //1) Specify whether puzzle should be rendered in NS 4.
    // "0" disables it (for use when you wish to place the puzzle inside table)
    var display_in_NS=1
    
    //2) Configure second and third parameter below for puzzle image/size
    //Make width and height divisible by 3
    myPuz=new Puzzle('myPuz',randomImages[0],141,255)
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jan 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you very much!

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
  •