Scrolling to tab with Anchor Link

Hi there,
On this page -https://whiteriverover.wpengine.com/upfitting/, I am trying to create a link that will scroll to or load individual tabs as they are clicked. On the top right, I have Our Areas of Expertise, and I would like to make those link to the tabs below so when someone clicks on Solar Power & Electrical, it opens that tab, and so on. How would it be possible to do that? I have tried the anchor links, but they don’t work as they normally do.

Thanks for the help!

Thanks for reaching out!

To achieve your desired layout, you can add a unique Toggle Hash in each of your tabs.

Then in your list, you can add a link to open the specific tab. Something like this one: <a href="#tab-e302-e5">Tab 1</a>

Hope that helps.

Ok that’s great! Thank you!

So I have that working now, and it is loading the tab but not navigating to that part of the page. Is it possible to get it to scroll to that part of the page as well? You can see it currently on this page https://whiteriverover.wpengine.com/upfitting/#solar-power-electrical

Thanks so much!

Hello @powrider686,

You are having a jQuery error in the console. Can you please update it from this:

/* <![CDATA[ */
$(".button-container-class a").click(function() {
$('html,body').animate({
   scrollTop: $(".section-to-scroll-to").offset().top},
   'slow');
});
/* ]]> */

Into this:

/* <![CDATA[ */
    (function( $ ) {
        $(".button-container-class a").click(function() {
            $('html,body').animate({
            scrollTop: $(".section-to-scroll-to").offset().top},
            'slow');
        });
    })( jQuery );
/* ]]> */

Be advised that custom coding is beyond the scope of our support under our Support Policy. If you are unfamiliar with code and resolving potential conflicts, you may select our One service for further assistance.

Best Regards.

Ok, I updated that. I have removed that, I found it in another ticket. There is no scrolling happening still. How can I get it to scroll to the right place like an anchor ID would do? Thank you so much!

Hello @powrider686,

Please check out the JS code on the old thread:

Best Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.