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.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Two Javascript programs: how to make them both work?

    I'm new to Javascript, so this may be a dumb question...but I have two Javascript programs on the same webpage, but I'm not sure how to make them both work at the same time. One is a Looped Slideshow and the other is a Lightbox. The Lightbox "overrides" the slideshow, so how do I make them both work at the same time in perfect harmony??

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,173
    Thanks
    203
    Thanked 2,549 Times in 2,527 Posts
    Quote Originally Posted by wendyamstar View Post
    I'm new to Javascript, so this may be a dumb question...but I have two Javascript programs on the same webpage, but I'm not sure how to make them both work at the same time. One is a Looped Slideshow and the other is a Lightbox. The Lightbox "overrides" the slideshow, so how do I make them both work at the same time in perfect harmony??
    This topic has ben raised very many times in this forum. Try using the search feature. But if you are trying to use two different Javascript frameworks at the same time, then conflicts may occur which cannot be resolved. As you do not give more information about which scripts you are using then that is as far as I can go.

    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,798
    Thanks
    6
    Thanked 1,023 Times in 996 Posts
    Yeah, I suspect the same thing: Two randomly copied and pasted scripts from the internet without enough knowledge on how to use them. And if I had to guess I would say the slideshow is jQuery and the lightbox is prototype.

    And I’m tired of repeating it over and over again so I’m gonna make it short this time: Don’t use two different JS libraries in the same document, there are most likely plugins for everything in either of the two.


  •  

    Posting Permissions

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