Same Tab content over three different pages, how to active the coreesponding tabs according to the page id wordpress

72 views Asked by At

Same Tab content over three different pages, how to active the coreesponding tabs according to the page id wordpress

1

There are 1 answers

0
Mohan Kumar R On
<script>

jQuery(document).ready(function() {
    var tar=jQuery(location).attr('href');
    if(tar=="pageid1")
    {

        jQuery("#tabMenu li:eq(2) a").tab('show');
        jQuery("#tabMenu li:eq(2) a").addClass('active');

    }
    if(tar=="pageid2")
    {

        jQuery("#tabMenu li:eq(0) a").tab('show');
        jQuery("#tabMenu li:eq(0) a").addClass('active');

    }
    if(tar=="pageid3")
    {

        jQuery("#tabMenu li:eq(1) a").tab('show');
        jQuery("#tabMenu li:eq(1) a").addClass('active');

    }


      });



</script>