Link to nestable tab

Hello, is it possible to have a url link directly to a nestable tab? Basically have it open when the page loads if a parameter is present in the url.

If anyone is interested, I managed to do this by adding the desired id (e.g. “#amsterdam-title” and “#amsterdam-content”) to the tab titles and panes and using the following script.

<script>
	jQuery(document).ready(function( $ ) {

    var hash = window.location.hash;

    if(hash && $(hash + '-title').length != 0){
      $( ".tab-title, .tab-pane" ).each(function() {
        $(this).removeClass('brx-open');
      });

    	$(hash + '-title').addClass('brx-open');
    	$(hash + '-content').addClass('brx-open');
    }

  });
</script>
1 Like

Hi @Kyriakos
thank you
I don’t get it. I have 5 tabs with id’s #mytab-1 to 5 and content with id’s #mycontent-1 to 5
How do I get a url to open any of them?

If you want my script to work you have to name the ids the same way because the script looks for the “title” and “content” part in the id name.

e.g.

#mytab1-title
#mytab1-content
#mytab2-title
#mytab2-content

Thank you

I have changed the 5 TITLES(the div in which the text element with title name) and PANES to;
#mytab1-title
#mytab2-title
#mytab3-title
#mytab4-title
#mytab5-title
AND
#mytab1-content
#mytab2-content
#mytab3-content
#mytab4-content
#mytab5-content

What should the url then be?? Example: https://mysite.com/page/#mytab1-title

I have then added your code exactly as is and to run site-wide.

The url should be https://mysite.com/page/#mytab1