Linking to anchor and a query string to open a tab

I found the solution here Tabs (tab link + anchor).
But there was not much of explanation, so I will try to be a bit more guiding here.

It is surprisingly simple.

You create a link like normal and connect it to an anchor,
like you would do normally with an in-page anchor link.
Then you give that link an ID. For example id="linkContact"

Next you go the tab menu and see what the ID is of the tab link of the tab you want to open.
Lets say it is id="contact".

Next you paste the following code in the before section:

<script>
$('#linkContact').click(function () {
	$('#contact').triggerHandler('click');
});
</script>

And that is it. A functioning in-page anchor link with a tab trigger.

The code I used (here above) is perfect for linking to an anchor and triggering a tab when they are on a different page.

1 Like