I am working on a project where had links to other pages for example
<a href="/services#FB-Lead-Generation">
so when I click on the link from say homepage - it loads the page services, but it doesn't go the anchor #FB-Lead-Generation
I believe that it is not doing a full page re-load and hence the anchor tag is not working as when I access the link directly it goes to the anchor tag correctly.
how I can achieve this, that is when I click from homepage or other page, it goes to the specific id/anchor position.
Target html
<div id="FB-Lead-Generation" class="capability" data-capability="0">
<div class="capability__content">
<h2 data-reveal="up" class="reveal--up revealed">FB Lead Generation</h2>
<p data-reveal="up" class="reveal--up revealed">With a keen understanding of what's happening in the digital landscape, we leverage the power of google and social media we connect your targeted audiences with your product & services.</p>
</div> </div>
update for javascript:
e.default = function(t) {
var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]
, i = {
url: window.location.pathname + window.location.search,
method: "GET",
data: null,
headers: {}
}
, n = r({}, i, t)
, s = new XMLHttpRequest;
return s.onreadystatechange = function() {
4 === s.readyState && (s.status,
e(s))
}
,
s.open(n.method, n.url, !0),
Object.keys(n.headers).forEach((function(t) {
s.setRequestHeader(t, n.headers[t])
}
)),
s.send(n.data),
s
}