PDA

View Full Version : Probable conflict between Lightbox 2.03a and Bullet List Accordion Menu



curavon
10-29-2008, 11:41 PM
1) Script Title:
Lightbox 2.03a and Bullet List Accordion Menu

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex4/lightbox2/index.htm
http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu-bullet.htm

3) Describe problem:
First off, let me say that I'm aware that this type of problem is not typically addressed in the forums. However, I'm hoping someone might be willing to help as was the case in a similar thread: http://www.dynamicdrive.com/forums/showthread.php?t=37797

Simply put, I am trying to use the Lightbox effect on images revealed by the accordion menu.

Here is the page where I'm attempting to do this: http://creativemerc.com/testing/dvdandrea/index.html

When the visitor clicks on the "Prints" image, for instance, it should open to reveal a number of thumbnails that can be clicked to view their enlargements via Lightbox.

I'm fairly certain that it is a conflict between Lightbox and the accordion menu because each of the elements works when the other is removed.

I'm hoping that a fix similar to the one detailed on http://www.dynamicdrive.com/forums/showthread.php?t=37797 will be possible. I even went so far as to make the adjustments to the javascript files described on that thread but had no luck.

I appreciate any information that you could provide.

jscheuer1
10-30-2008, 05:20 AM
First of all, Accordion Menu uses the jQuery javascript library, while Lightbox 2.03a (including all other versions of Lightbox, though not all lightbox 'clones'/imitators) use the prototype.js library and supplements to it. These two libraries both make use of $ for many global functions, but they differ in how they do that, so conflicts are inevitable.

There are many ways to set jQuery to a no conflict mode though. So do that. Here's one fairly simple method:


(W)hat you can do is . . . inside ddaccordion.js, first do a search and replace, replacing all occurences of $ with $j. Then, and only then, add the below to the top of the file:


var $j = jQuery.noConflict()

Doing that will remove the main source of conflict. Other issues may or may not remain.

curavon
10-30-2008, 11:21 PM
Thanks for posting a reply so quickly, John.

Unfortunately, as I mentioned in my initial posting, I had already attempted that fix based on what you had said in another thread (http://www.dynamicdrive.com/forums/showthread.php?t=37797). Doing this had no effect at all on the page.

I did make another attempt to remedy the problem based on your reply to my initial posting, hoping that I had overlooked something, made an incorrect adjustment, etc. However, everything turned out the same: the conflict remains and the accordion menu and Lightbox elements continue to "cancel each other out."

Are there other adjustments that you could suggest I try?

Thanks again for your help.

jscheuer1
10-31-2008, 04:43 AM
I'm really not sure what the problem is, but I did get this somewhat cryptic error message in FF 3.03:


Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMViewCSS.getComputedStyle]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://creativemerc.com/testing/dvdandrea/js/jquery-1.2.6.pack.js :: anonymous :: line 11" data: no]
Source File: http://creativemerc.com/testing/dvdandrea/js/jquery-1.2.6.pack.js
Line: 11

I tried a number of things. What worked was upgrading to Lightbox 2.04a as described in the post you are referring to.

Lightbox 2.04a:

http://www.dynamicdrive.com/forums/showthread.php?p=163470#post163470

lightbox2.04a.zip:

http://home.comcast.net/~jscheuer1/side/lightbox2.04a/lightbox2.04a.zip

curavon
10-31-2008, 07:23 PM
Thanks, John -- that did the trick.

I had been thinking that I was using the latest Lightbox...thanks for pointing out that I was one digit off...