jQuery Accordion Menu V2: Make all 2nd-level links clickable

jQuery based Accordion Menu with many themes.
Post Reply
norman
Site Admin
Posts: 1252
Joined: Sat Feb 07, 2004 9:55 pm

jQuery Accordion Menu V2: Make all 2nd-level links clickable

Post by norman »

For jQuery Accordion Menu V2.
Go to Design /Library / Layouts / AccordionJQ / Accordion Setup.

To make all second-level links clickable:

Look for the line:

Code: Select all

		$('#dpacmn > div').each(function(){	// look for empty entries and disable arrows & click
Immediately above it insert:

Code: Select all

		$("#dpacmn h5 a").click(function() {
		 window.location = $(this).attr('href');
		 return false;
		});  
Norman
leej
Posts: 46
Joined: Thu May 17, 2007 10:03 am
Location: Otley, Leeds
Contact:

Re: jQuery Accordion Menu V2: Make all 2nd-level links click

Post by leej »

Hi Norman,
Would the same principle apply if you wanted the third level clickable also? e.g.

Code: Select all

      $("#dpacmn h6 a").click(function() {
       window.location = $(this).attr('href');
       return false;
      });  
norman
Site Admin
Posts: 1252
Joined: Sat Feb 07, 2004 9:55 pm

Re: jQuery Accordion Menu V2: Make all 2nd-level links click

Post by norman »

Seems to work. I put it above the line:

Code: Select all

		$('.dpacsm2 > div').each(function(){	// look for empty entries and disable arrows & click
Not sure why you didn't just try it yourself.

Slightly more readable would be to use:

Code: Select all

      $(".dpacsm2 h6 a").click(function() {
       window.location = $(this).attr('href');
       return false;
      }); 
Norman
leej
Posts: 46
Joined: Thu May 17, 2007 10:03 am
Location: Otley, Leeds
Contact:

Re: jQuery Accordion Menu V2: Make all 2nd-level links click

Post by leej »

I did try it before posting and it didn't work unfortunately. I had the incorrect running order and have since changed it which has now worked. Many thanks.
Post Reply