Page 1 of 1

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

Posted: Wed Mar 16, 2016 11:34 am
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;
		});  

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

Posted: Fri May 06, 2016 12:12 pm
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;
      });  

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

Posted: Fri May 06, 2016 12:31 pm
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;
      }); 

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

Posted: Fri May 06, 2016 12:51 pm
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.