PDA

View Full Version : Accordion menu not working properly when used with lightbox



dd_lx
02-13-2009, 06:20 PM
1) Script Title: Accordion Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu-bullet.htm?expandable=0

3) Describe problem:
Hello,
I have this strange problem with accordion menu when used on pages with lighbox, that it collaps all unfolded submenus. I've changed all $ to j$ in ddaccordion.js and added var $j = jQuery.noConflict() as mentioned in this thred (http://www.dynamicdrive.com/forums/showthread.php?t=29309), but it didn't solve problem.
Project that I'm working on could be found on http://nehlsen.nunointeractive.eu
and the problem could be seen on pages with galleries under PROFIL FIRMY/galeria3

Regards,
luke

Nile
02-13-2009, 09:07 PM
Try this:


var j$ = jQuery;
j$.noConflict();

dd_lx
02-13-2009, 11:42 PM
Unfortunetly didn't help :(
luke

Nile
02-15-2009, 12:39 AM
Try:


var j$ = jQuery;
jQuery.noConflict();

jscheuer1
02-15-2009, 05:21 PM
That doesn't really work, at least not that I've seen. There is apparently some other conflict in addition to control of the $ variable. I believe it lies in scriptaculous or effects but I've been unable to track it down and positively identify it, let alone come up with a fix.

What I've been recommending is to switch to a jQuery based Lightbox like:

http://leandrovieira.com/projects/jquery/lightbox/

or:

http://plugins.jquery.com/project/jquerylightbox_bal

Whichever you use, make sure you have only one external tag on your page for jQuery, and that it comes before the scripts that use it. Also, with:

http://leandrovieira.com/projects/jquery/lightbox/

The download has been updated to version 5, but the instructions on the site are still for version 4. I prefer this one, but be sure you are linking to the script in the download archive, not to the version 4 one as mentioned on the site.

Switching to a jQuery based lightbox for a page or pages already using jQuery for another script will also result in significant code savings, speeding the loading of your page.

You can even use the newer version 3 jQuery, which runs faster. If you do that, and are using the version 5 script for Lightbox I was mentioning, change (in its initialization on your page):


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

to:


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

dd_lx
02-16-2009, 03:13 PM
Dear John,
Thank You for helping me solving this problem.
Right now I know, that combaining those two scripts will not work.
At this time I'll try to go for Slimbox gallery scritp that uses mootools, becouse it was bounded with MaxiGallery that works with MODX CMS that I'm using.
If it will not work, than I'll go for sugested, jquery based gallery script.
Regards,
luke