Viewing 3 replies - 1 through 3 (of 3 total)
  • Good question.

    How can we load the page, and pass it the tab to select?

    Plugin Author wpshopmart

    (@wpshopmart)

    Hello @alberthart & @crowspath,

    Here is solution for current topic.

    Add below custom js on your website using any custom js plugin. I have suggest this plugin to add below custom js

    jQuery(document).ready(function(){
      activaTab_90('2');
    });
    
    function activaTab_90(tab){
      jQuery('a[href="#tabs_desc_90_' + tab + '"]').tab('show');
    };

    Note : Here you will need to replace some numbers 1) replace “90” with your tab shortcode id. and then replace “2” with you your selected tab number which is you want to active on page load.

    Check screenshot for help – https://postimg.org/image/t0kecj6yh/

    Let me know if you will require any other help.

    Thanks

    • This reply was modified 7 years, 3 months ago by wpshopmart.

    I think we want to replace ‘2’ with a URL parameter, using something like:

    function getParameterByName(name) {

    url = window.location.href;

    name = name.replace(/[\[\]]/g, “\\$&”);
    var regex = new RegExp(“[?&]” + name + “(=([^&#]*)|&|#|$)”),
    results = regex.exec(url);
    if (!results) return null;
    if (!results[2]) return ”;
    return decodeURIComponent(results[2].replace(/\+/g, ” “));
    }

    jQuery(document).ready(function()
    {
    var tab = getParameterByName(“tab”);
    if (tab)
    {
    activaTab_90(tab);
    }
    }

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Set active tab on page load’ is closed to new replies.