question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change of tab by its id doesn't work

See original GitHub issue

The following code doesn’t work:

$('#2').tab('show');
...
<div class="tab-pane" id="2">
...

Issue Analytics

  • State:closed
  • Created 12 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mdocommented, Apr 1, 2012

The problem with the ids has been resolved—in Components, it’s now #tab1, #tab2, etc.

Your second issue is because you are targeting the tab’s content instead of the tab itself, which is what the docs show to do. I’ve updated your fiddle to show this: http://jsfiddle.net/BM973/22/. Note the .tab2 on the second tab’s anchor.

I’m unsure what your third issue is though. I’m going to close this out though, so please open a new issue if that still needs addressing.

0reactions
and7eycommented, Mar 12, 2012

The following issues I see with regards to the tabs:

  1. incorrect documentation - ids are numeric in example;
  2. .tab('show') doesn’t work for me both in Firefox 10 and latest Сhrome - http://jsfiddle.net/and7ey/BM973/9/;
  3. my code to change tab - http://jsbin.com/atinel/12/edit#preview - works, but not fully correct - none of them scrolls to the top of tab in latest Firefox (but works well in Chrome).
Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't access a tab using id in the URL outside of the page
It works ok when i navigate through tabs inside the projects page, and if i hover on the tab "Orange" i can see...
Read more >
How do I get the data of the current tab? — DataTables forums
The problem is that using .show() and .hide() to show/hide rows only changes the DOM display. Datatables doesn't know about these changes.
Read more >
tabs.update() - Mozilla - MDN Web Docs
To use this function, pass the ID of the tab to update, and an updateProperties object containing the properties you want to update....
Read more >
How to link to a specific tab through a #id link in the url
There are 2 things you need to make sure of: 1. Disable the tab continuity, otherwise, tab continuity will override whatever you do...
Read more >
Problem With Linking to tab with url | WordPress.org
All the other tabs doesn't work when trying to navigate directly from url to a ... tabs on the tab panel, it doesn't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found