Hi there
I’m trying to get a button click on a page to scroll down to a certain section of that same page and open the accordion.
This is the page in question: http://www.gilbertsondavis.com/ontario-arbitrators-mediators/
So if you click on the blue button in the hero banner “David Alderson, LL.B, LL.M, Q,Arb Hourly Rate: From $350 an hour* >” The accordion opens, but is no longer scrolling to that section.
The code I have implemented right now is this:
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');
}
});
var uri= window.location.href;
var result = uri.split("/").pop();
if (result.indexOf('#') >= 0) {
setTimeout(function(){$('.open_accordion[href="' + result + '"]').trigger('click');}, 100);
}
});
Can you help with any modification to this to have the scroll function come back?
Thanks alot.