title: Link to anchor and open accordion
body: <p>How do I open an accordion panel by using an external anchor link?</p>
  
  <p>I've tried using an anchor link and it just loads the page, without opening the panel.</p>
  
  <p>What I'm trying to achieve is that when the anchor link is clicked, the page loads, scroll to the panel and then open the accordion.</p>
  
  <p>This link is the one that will anchor to the other page and should open the accordion:</p>
  
  <pre><code> &lt;a class="linkTo" href="/project#&lt;?php the_sub_field('area_link'); ?&gt;"&gt;
  </code></pre>
  
  <p>This is the code I am using to open the accordion on click:</p>
  
  <pre><code> $(document).ready(function() {
     $(".accordion .accord-header").click(function() {
       // for active header definition
       $('.accord-header').removeClass('on');
       $(this).addClass('on');
  
       // accordion actions
       if($(this).next("div").is(":visible")){
         $(this).next("div").slideUp(600);
         $(this).removeClass('on');
       } else {
         $(".accordion .accord-content").slideUp(600);
         $(this).next("div").slideToggle(600);
       }
    });
  });
  </code></pre>
  
  <p>This is the accordion structure:</p>
  
  <pre><code>&lt;div class="accordion"&gt;
    &lt;div class="accord-header" id="&lt;?php the_sub_field('area_link'); ?&gt;"&gt;Accordion 1&lt;/div&gt;
      &lt;div class="accord-content"&gt;
          &lt;!-- Content --&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>