Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 24
  1. #1
    Regular Coder Tyree's Avatar
    Join Date
    Sep 2003
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help on making multiple instances of a script work on a page.

    I am wanting to put 6 slide shows on one page...however, when I do so using the same script (which is self-contained, no script in the head tag) only the last instance on the page works.

    I have tried adding numbers to the end of all the variables that I know of...to no avail.

    Would someone mind looking at this page
    http://www.craddockcunningham.com/indextemp.html
    and giving the code a quick look. I know it's bound to be something simple, I'm just not catching it.

    Thanks a ton!
    Matt Tyree

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've got a slideshow that allows multiple instances. My demo page has 4, but 6 is certainly possible. Let me know if you like what you see.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #3
    Regular Coder Tyree's Avatar
    Join Date
    Sep 2003
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I like that a lot actually. What's the catch?

    Thanks!
    Matt

  • #4
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Nothing, just keep the copyright in tact, and inform me post-haste of any bugs you might find.

    http://www.peterbailey.net/dev/jsclasses/

    Enjoy.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #5
    Regular Coder Tyree's Avatar
    Join Date
    Sep 2003
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts
    One question....does the slide show allow me to input a separate link for each image in the slideshow...a link that can pop up in a new window? The goal is to have a larger version of each image in the slideshow pop up in a new window.

    Thanks!!!

  • #6
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes, the demo page includes a link to the demo w/links.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #7
    Regular Coder Tyree's Avatar
    Join Date
    Sep 2003
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oh my dear goodness...this is gonna take a bit to figure out!

  • #8
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You won't need to change anyting in the class code - it's just how you create slideshows that changes. I haven't written any docs for this, so lemme know if you get stuck.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #9
    Regular Coder Tyree's Avatar
    Join Date
    Sep 2003
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am a bit stuck...

    It's doing something very bizarre...as far as I can tell I have placed the 6 shows as you did the 4 on your demo...but only my first show plays...and when it does it plays the first slides really fast and then stops....the rest just load the first image and stop.

    Any help would be most appreciated...Here's the test url:

    http://www.craddockcunningham.com/indextest.html

    Thanks!
    Matt

  • #10
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    First thing I see wrong is that you're running the play method on the first instance, ss1, each time. You need enact the play method for each instance, so
    Code:
    function init()
    {
        var delay = 2500;
        var imgRoot = 'http://www.craddockcunningham.com/images/job_pics/adapt/';
    
        var ss1 = new SlideShow( 'slide1', 'slide1Link', '', '', imgRoot, 'resiData', 1, 0);    
        var ss2 = new SlideShow( 'slide2', 'slide2Link', '', '', imgRoot, 'eccData', 1, 0);    
        var ss3 = new SlideShow( 'slide3', 'slide3Link', '', '', imgRoot, 'commData', 1, 0);    
        var ss4 = new SlideShow( 'slide4', 'slide4Link', '', '', imgRoot, 'muniData', 1, 0);    
        var ss5 = new SlideShow( 'slide5', 'slide5Link', '', '', imgRoot, 'adaptData', 1, 0);    
        var ss6 = new SlideShow( 'slide6', 'slide6Link', '', '', imgRoot, 'indeData', 1, 0);    
    
        ss1.play( delay );
        ss2.play( delay );
        ss3.play( delay );
        ss4.play( delay );
        ss5.play( delay );
        ss6.play( delay );
    }
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #11
    Regular Coder Tyree's Avatar
    Join Date
    Sep 2003
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay...in the end they will all have different image roots....so what then? The way you just showed seems to make them all have the same root. I was setting them all up separately as you did in your demo with the 4 shows.

    Thanks so much for your help, by the way!!!

  • #12
    Regular Coder Tyree's Avatar
    Join Date
    Sep 2003
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Nevermind...if I had payed attention I would have seen what you did...just made those two things reoccuring variables...So, how is that different from how I did it? I had each show play as well.

  • #13
    Regular Coder Tyree's Avatar
    Join Date
    Sep 2003
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts
    LOL...maybe I should reserve comment until I actually LOOK at my code...I see what you mean...I still had "ss1" for all 6 instances.

    Thanks!!!

  • #14
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hehe, no problem.

    And yes, I just made the root and delay variables for brevity's sake
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #15
    Regular Coder Tyree's Avatar
    Join Date
    Sep 2003
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay...Man...this is a good script...

    I just added the filters/wipes to them....but I can't upload the working file yet...stupid server is messed up. I will let you know when I get it. Like to get your thumbs up on it.

    Are there any other filter effects you can do besides the wipe?


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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