Skip to content
This repository was archived by the owner on Aug 6, 2019. It is now read-only.
This repository was archived by the owner on Aug 6, 2019. It is now read-only.

Useful Snippet: How to detect which tab (by name) you are on.  #232

@samjco

Description

@samjco
$('#rootwizard').bootstrapWizard({onTabShow: function(tab, navigation, index){

var currTabURL = tab.context.toString(),
      getFullUrl = window.location;

// current tab with url
console.log('current tab url= '+currTabURL);
// current full url
console.log('complete url= '+getFullUrl);
// just the current tab
var currTab = currTabURL.replace(getFullUrl, "");
console.log('just the tab= '+currTab);

// Then you can do something like:
 if (currTab == '#your-tab-name'){
  //do something
 }else(
  //do something
 }

}}); 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions