0

I used answer found Twitter Bootstrap Tabs: Go to Specific Tab on Page Reload or Hyperlink

and it works great.

But the default tab loads first and then switches to the correct tab.

How can I show the wanted tab at load?

I'm calling the javascript functions found in the above link in document.ready.

Community
  • 1
  • 1
eugene
  • 39,839
  • 68
  • 255
  • 489
  • 1
    fiddle demonstrating the issue? Or at least some code? – Andrew Grothe Oct 01 '13 at 11:59
  • Maybe some other script/file is blocking so document.ready is fired late. The code itself shouldn't be slow. – Jeroen K Oct 01 '13 at 11:59
  • just data being loaded on the page is rather large.. about 10 screen pages of data. I guess document.ready is called late, and wanted to know if there's a better place to call the functions. – eugene Oct 01 '13 at 12:05
  • just don't put the call in document ready. Js should all be at the end of the page anyway, meaning there's no _need_ to wait for document ready, and for something like "select the right tab" there's no logical reason to wait for, what sounds like, a significant chunk of blocking js to run first. – AD7six Oct 01 '13 at 14:47

1 Answers1

0

If there are other javascripts on that page, then try to move the code up that loads the data that you would like to display. But if there's nothing else, then try to make the ajax call faster :)

Gavriel
  • 18,880
  • 12
  • 68
  • 105