Solution 1 :

Use jquery to add and remove activation class on a required tab or you can stimulate click functionality

Problem :

I use Boostrap 4 Navbar tabs https://getbootstrap.com/docs/4.4/components/navs/#javascript-behavior and need to jump to a specific tab on another page:

<div class="container">
    <div class="row">
        <a href="https://example.com/services#nav-tab-1">
            <img src="https://example.com/wp-content/uploads/icons/icon-1.svg">
        </a>

        <a href="https://example.com/services#nav-tab-2">
            <img src="https://example.com/wp-content/uploads/icons/icon-2.svg">
        </a>

        <a href="https://example.com/services#nav-tab-3">
            <img src="https://example.com/wp-content/uploads/icons/icon-3.svg">
        </a>                            
    </div>
</div>

On the second page I need after page is loaded trigger same nav tab link:

<div class="container">
    <div id="nav-tab" class="row nav">
        <div id="nav-tab-1" class="col-4 wow fadeInUp nav-item nav-link active" data-toggle="tab" href="#tab-1" role="tab" aria-controls="nav-1" aria-selected="true">
            <img src="https://example.com/wp-content/uploads/icons/icon-1.svg">
        </div>
        <div id="nav-tab-2" class="col-4 wow fadeInUp delay-1 nav-item nav-link" data-toggle="tab" href="#tab-2" role="tab" aria-controls="nav-2" aria-selected="false">
            <img src="https://example.com/wp-content/uploads/icons/icon-2.svg">
        </div>
        <div id="nav-tab-3" class="col-4 wow fadeInUp delay-3 nav-item nav-link" data-toggle="tab" href="#tab-3" role="tab" aria-controls="nav-3" aria-selected="false">
            <img src="https://example.com/wp-content/uploads/icons/icon-3.svg">
        </div>
    </div>

    <div class="row">
        <div id="nav-tabContent" class="col-12 col-sm-7 tab-content">
            <div id="tab-1" class="tab-pane fade show active" role="tabpanel" aria-labelledby="nav-home-tab">
                Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum justo eros, aliquet et maximus at, tempus ut risus. In aliquet nulla massa, a hendrerit nisi volutpat vitae.
            </div>

            <div id="tab-2" class="tab-pane fade" role="tabpanel" aria-labelledby="nav-home-tab">
                Nullam sapien nibh, ornare ac arcu eget, ultrices lobortis tellus. Cras sodales dictum lorem id luctus.
            </div>

            <div id="tab-3" class="tab-pane fade" role="tabpanel" aria-labelledby="nav-home-tab">
                Nullam mi ligula, tempor at nulla in, malesuada vestibulum leo. Ut eget tristique quam. Donec rhoncus placerat molestie. 
            </div>
        </div>
    </div>
</div>

Every icon with hyperlink (code snippet nr. 1) represents one from three tabs on second page. When user clicks on any icon with hyperlink (code snippet nr. 1) on first page, it should go to next page and open appropriate tab.

Comments

Comment posted by Carsten Løvbo Andersen

Now sure you need the whole url try with

Comment posted by Juraj

Thanks for response, tried and it’s not working…

Comment posted by MattOpen

could you please precise your question? When “need to jump to a specific tab on another page” and from where and how? it is totally not clear to me.

Comment posted by Juraj

Every icon with hyperlink (code snippet nr. 1) represents one from three tabs on second page. When user clicks on any icon with hyperlink (code snippet nr. 1) on first page, it should go to next page and open appropriate tab. Even better, if page will scroll down to whole section 🙂

By