Home › Forums › JavaScript › Lightbox 2 problems
- This topic is empty.
-
AuthorPosts
-
November 14, 2011 at 10:09 am #35156hal8Member
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 !!
November 14, 2011 at 11:31 am #90610akeenlabsParticipantAt 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.
November 14, 2011 at 11:50 am #90612hal8MemberThanks for the advice akeenlabs.
I have tried removing it, but still will not work !
Any other ideas ?
November 14, 2011 at 12:05 pm #90613thomasMemberWhat’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/November 14, 2011 at 1:43 pm #90617akeenlabsParticipantI’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.
November 15, 2011 at 2:56 pm #90697hal8MemberRight 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 !!!! :(
November 16, 2011 at 10:46 am #90734akeenlabsParticipantNow, your prototype.js is throwing an error: “Object #
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.
November 18, 2011 at 5:10 pm #90946hal8MemberOk Thanks for the help.
I have changed it to a jquery lightbox but still no joy ahhhh !! :(
November 19, 2011 at 3:47 am #90961hal8MemberMy bad. I had the jquery path link wrong. Thanks for the help
November 19, 2011 at 6:49 am #90967MottieMember@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).
-
AuthorPosts
- The forum ‘JavaScript’ is closed to new topics and replies.