Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author malihu

    (@malihu)

    You can’t do it directly with the WordPress plugin. You have to manually add an extra custom script in your theme to do it. Something like the following:

    $("a[href*='#southern']").click(function(e){
        e.preventDefault();
        $(".tab.tab_counter_1").trigger("click");
    });

    Thread Starter kaylesimon

    (@kaylesimon)

    I see. So I’d have to add a script for every single instance, then? I’m thinking that is not really a workable solution going into the future for us. Thanks for letting me know, though.

    Plugin Author malihu

    (@malihu)

    For the code I posted yes.

    ‘Page scroll to id’ scrolls the page to an id and your tabs script/plugin creates tabs. You need custom code to associate the 2 scripts/plugins, simply because the tabs script does not scroll the page and ‘Page scroll to id’ cannot detect tabs or trigger other scripts events.

    A “proper” re-usable solution that would automate this process, would be the creation of a custom script which should a)get link’s href id value, b)see if a target with such id exists and has a parent tab, c)get the parent tab id and open it.

    Thread Starter kaylesimon

    (@kaylesimon)

    Thank you so much. We clearly will need to hire someone to help with this no matter what plugin we use, unless we want to give up entirely on using tabs we can link into beyond the usual /#tab-id-2 in the url. Which works fine, btw, other than the fact that it opens to the tab box’s center instead of the top, much of time. Seems to vary distrurbingly, which is what sent us looking for some other way.

    I do appreciate the additional information to guide us on our way. If you do custom work and have any interest yourself, please let me know at [email protected].

    Plugin Author malihu

    (@malihu)

    No problem 🙂 I’ll send you an email.

    Hi Malihu

    re: extra custom script…
    1. Is this placed in the header.php file?
    2. Is there anything else that has to be included with the custom script?
    3. Where exactly does it need to be place as I tried and I keep getting a white screen.

    Plugin Author malihu

    (@malihu)

    @torkos

    You can place the script in header.php or footer.php (just before the closing body tag). The complete code for the example I posted above should be:

    <script>
        (function($){
            $(window).load(function(){
                $("a[href*='#southern']").click(function(e){
                    e.preventDefault();
                    $(".tab.tab_counter_1").trigger("click");
                });
            });
        })(jQuery);
    </script>
Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘targets within tabs’ is closed to new replies.