Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Lightbox 2 problems

  • This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #35156
    hal8
    Member

    Hi

    Can anyone please help. I am trying to use the jquery lightblox 2 for the first time, but its not working !!….can anyone help….it is probably just something basic !!

    Link

    #90610
    akeenlabs
    Participant

    At a glance, it looks like you’re loading 2 different copies of jQuery. The second copy (a local copy called jquery.js) is being loaded after the jQuery plugins. My guess is you’re overwriting the plugins because that second jQuery copy redefines the variable on which the plugins reside.

    The JavaScript errors sort of confirm this:

    • has no method ‘cycle’
    • has no method ‘lightbox’
    • has no method ‘cycle’

    Try removing that second reference and see if it solves the problem.

    #90612
    hal8
    Member

    Thanks for the advice akeenlabs.

    I have tried removing it, but still will not work !

    Any other ideas ?

    #90613
    thomas
    Member

    What’s the @ symbol for in the following line?

    $('a[@rel*=lightbox]').lightBox();

    It’s giving a syntax error.
    http://api.jquery.com/attribute-contains-selector/

    #90617
    akeenlabs
    Participant

    I’m showing a 500 internal server errors on several of your files:

    • jquery.lightbox-0.5.css
    • scripts.js
    • jquery.lightbox-0.5.js

    The only JavaScript error I’m seeing is “object has no method ‘lightBox'”; since the lightbox file isn’t being served, that makes sense.

    Also, thomas is right, the @ symbol should not be there.

    #90697
    hal8
    Member

    Right ok, so i have tried it all again, but now when i try it stops the jquery image fader working and the lightbox still will not work !!!! :(

    #90734
    akeenlabs
    Participant

    Now, your prototype.js is throwing an error: “Object #has no method ‘dispatchEvent'”. Which browser are you using to test with? I recommend either Firefox + Firebug or Chrome so you can see these error messages easily yourself.

    Even if you weren’t getting that error, I don’t see the JavaScript for your lightbox in there anymore, so I wouldn’t expect that part to work anyways :)

    As a side note, your cycle library uses jQuery while your lightbox uses Prototype. I don’t think this is a good idea as they can mess with each other. Pick one JS library and use it, don’t mix and match. If you want to use jQuery, checkout Colorbox or just search Google and pick one. This may be where the dispatchEvent error is coming from.

    #90946
    hal8
    Member

    Ok Thanks for the help.

    I have changed it to a jquery lightbox but still no joy ahhhh !! :(

    #90961
    hal8
    Member

    My bad. I had the jquery path link wrong. Thanks for the help

    #90967
    Mottie
    Member

    @akeenlabs: The “@” symbol in the selector was the original jQuery selector method for attributes… so whenever you see it, it means the code is using jQuery 1.2 or something, so it’ll need to be removed if you plan on using an updated version.


    @hal8
    : That gallery page is still loading two copies of jQuery: 1.2.3 and 1.4.2. And right now I see an error that it doesn’t recognize the jQuery cycle plugin because of this. So I recommend replacing this code





    with this code (updated jQuery included).



Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.