0

Click on this link: https://phonestage.wpengine.com/documentation/#admin_guide_2

See, There is a ID(#admin_guide_2) on the last part of the link. I made this work with the page content, So when you load this page, You will see the correct associate with this ID. On the left side this ID also exists on the "Step 1: Authentication". I want this link will focus when someone comes with that link. Any idea how to do it?

  • hi @mplungjan, Actually scroll on page load is works. My question is about the a:focus on the left sidebar. a:focus is not working after the page load on the left sidebar – Abid Hasan Oct 13 '19 at 07:03

1 Answers1

0

Like this

var hash = "#admin_guide_3" // location.hash

$(function() {
  $("a").filter(function() {
    var href = $(this).attr("href");
    return href ? href.substring(href.indexOf("#")) === hash : false;
  }).focus();
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<a name="something">Nothing</a>
<ul>
  <li><a href="/documentation/#admin_guide_2">Step 1: Authentication</a></li>
  <li><a href="/documentation/#admin_guide_3">Step 2: Configuration &amp; Setup</a></li>
  <li><a href="/documentation/#admin_guide_4">Disconnecting the Telephony Integration or Starting Over &#8211; ADMIN USE ONLY</a></li>
</ul>
mplungjan
  • 169,008
  • 28
  • 173
  • 236