Results 1 to 7 of 7

Thread: Lightbox 2.03a not working

  1. #1
    Join Date
    Nov 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Lightbox 2.03a not working

    1) Script Title: Lightbox image viewer 2.03a

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...box2/index.htm

    3) Describe problem: Can't get lightbox to work.


    I can't get lightbox to work on this page http://joligateau.com/gallery.php

    Is it possible there's script conflict? I've done this before but not sure why its not working this time. I've included the code within the head and followed the instructions as per the instructions. I've placed the "rel" link to the images but when I click on the image, it just opens up the larger version in a new window.

    I've made sure to upload all the files onto the server and made sure the paths are correct as well. I've even tried moving all files to the root and still doesn't work. I've cleared cache in FF 4.0 and do a hard refresh each time.

    I hope its not some stupidity I overlooked I feel real dumb posting but I'm running out of ideas. Thanks for your help.


    Al

  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

    Get rid of this:

    Code:
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    - John
    ________________________

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

  3. #3
    Join Date
    Nov 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That was it!! thanks for the quick reply John... was driving me nuts. appreciate it!!!


    AL

  4. #4
    Join Date
    Jan 2011
    Posts
    51
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Default Why?

    I do not quite understand. That's what I thought at first, but to my surprise neither in the internal code page of DD, nor even that I remember in the original author's page, I found no reference to the use of this basic library. Why?

    Luys

  5. #5
    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

    Quote Originally Posted by Luys View Post
    I do not quite understand. That's what I thought at first, but to my surprise neither in the internal code page of DD, nor even that I remember in the original author's page, I found no reference to the use of this basic library. Why?

    Luys
    And that's why removing it fixed the page.
    - John
    ________________________

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

  6. #6
    Join Date
    Jan 2011
    Posts
    51
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Default Two echoes?

    Hi all!

    2John: Apparently, I saw the code above and I assumed that as usual was more an oversight than anything else ...
    So to have an "unnecessary" reference on a page to the jQuery library it is a hindrance to the execution of other scripts? (This is the case if I use a template for many web pages and some don't need actually the jquery .js file).
    Best regards.

    2alphadeck: I take a look to the internal source code of your [beautiful] web page with Opera browser and I can see TWO instances of "body onload" tag and TWO scripts that may be the same (one on head, another on body). When I check out this with an old program like Nvu editor, I can see only one perhaps because the application fixed it!
    Pay attention, please.

    Luys
    Last edited by Luys; 05-17-2011 at 11:38 AM.

  7. #7
    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

    Yes. jQuery conflicts with Prototype/Scriptaculous. The two can be made to coexist on the same page, but it can be complicated. If you have both of them on the same page and only need one of them, and there is a conflict, the simplest thing is to remove the one you're not using.

    The reason they often conflict is that they both want to define the variable $ in the global scope and then use that as their primary way of identifying and initializing elements. They each define it differently, so only one or the other can win, sometimes they both lose.

    jQuery has a way of using noConflict mode. Slightly complex, but usually not too hard to write for as many of the jQuery scripts and plugins are already in noConflict mode or are noConflict mode ready. On that score, if your jQuery script or plugin is like that, you just have to make your initialization code also in noConflict friendly terms. But then the version of Prototype/Scriptaculous used can sometimes - depending upon the script(s) it is used for on the page, be an issue in some browsers. They usually can be updated, which then in turn may create the need to update the version of the script(s) using Prototype/Scriptaculous.

    As I say, it can get complicated. It's often better to use just one script library and stick to it. If done well, the user will only have to load it once for the entire site.
    - John
    ________________________

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

  8. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Luys (05-17-2011)

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
  •