0

I'm trying to jump from a url like to a bootstrap tab on another page but keep pulling blank. I thought i had this sussed but its beating me just now :/

    /page2.html#social

the tabs (i'm trying to get to via the url) use data-toggle and the div id is myTab

Showcase Imagery
  • 372
  • 2
  • 19

1 Answers1

0

I had to use a bit of javascript to make this work on my site. Here's what I did:

For my link, I appended a query string. Maybe in your case it would be something like: page2.html?tab=social.

Then on the page that I land on (in you case page2.html), I just have a switch statement that picks up on the query value and shows the tab I want:

var queryval = window.location.search;
switch (queryval) {
  case '?tab=social':   
    $('#social').tab('show');
    break;
  case ...

}

Works great for me.

jme11
  • 17,134
  • 2
  • 38
  • 48