Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #208236

    Rue Nel
    Moderator

    Hey Brian,

    I’ve tried some other solution that you can reuse. Try to this to your customizer:

    
    jQuery(document).ready(function($) {
      var hash = window.location.hash;
    
      if (hash != '') {
        $('.x-accordion-toggle').each(function(){
          if ( $(this).attr('href') === hash ) {
            $(this).removeClass('collapsed');
            $(hash).addClass('in').css('height', 'auto');
          }
        });
      }
    });
    

    The code above will check on the url with a hashtag. And if the url has a hashtag on it, it will look for the accordion and will try to match the hashtag to one of the accordion to your page. The code will work with other buttons you may have, just make sure to place the correct accordion id in your button href.

    e.g. <a href="your-page-link-here#ACCORDION-ID">button text</a>

    Please let us know if it works for you.

    #210255

    bmahoney59
    Participant

    Yes, that works now. Thank you for the help.

    -Brian

    #210590

    Rue Nel
    Moderator

    You are always welcome Brian!

    We’re glad that it works for you.

The topic ‘Linking to accordion item on another page’ is closed to new replies.