Anchor link to open accordian

Hi There
I’m trying to get an anchor link to open an accordion on the same page but can’t figure out how to do it.

The page is this: http://www.gilbertsondavis.com/ontario-arbitrators-mediators/
The accordions are on the bottom of the page.

Some help would be appreciate it. Thanks!

Hi,

Please refer to the link below

Hope that helps

Hi There
Thanks for the reply, I’ve tried this solution but it’s not working - jumping to the accordian is fine, but still not opening.

I implemented the solution here: http://www.gilbertsondavis.com/firm/diversity/
If you click on the button, you can see the problem - not sure what I’m doing wrong?

Thanks!

Hi there,

For your case, the button is classic one and not the V2 button. That is why the code should be:

jQuery(document).ready(function($) {
	$('.open_accordion.x-btn').click(function(e) {
		
		var $this = $(this);
		var thisHref = $this.attr('href');
		var accordion = $(thisHref).find('.x-accordion-toggle');

		if ( accordion.length && $(thisHref).hasClass('x-accordion-group') ) {
			e.preventDefault();

			accordion.trigger('click');
		}

	});
});    

I tested the code and it worked on the front end of your website.

Thank you.

1 Like

Thank you very much! That worked great!
One last question, on this page: http://www.gilbertsondavis.com/ontario-arbitrators-mediators/

The 3 buttons at the top with people’s name, what CSS do I need to add to make it change color on hover?

Thanks

Hello there,

Please add this CSS code:

.x-btn.x-btn-flat:hover {
    background-color: #ffffff !important;
    color: #116a97 !important;
}

Then change #ffffff and #116a97 to the color that suits your needs.
Please be reminded that color designates to text color.

Hope it helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.