tmacfarlane — 2010-05-10T14:08:23-04:00 — #1
I tried to avoid installing the jQuery UI for only one page that uses very simple tabs. I built the tabbed page using directions from JQUERY: Novice to Ninja. They work just fine, but I cannot figure how to link to an open tab on the page that is not the default open one. Can anyone help me figure out how to do this? I have posted a simplified mockup at:
paul_wilkins — 2010-05-10T17:36:56-04:00 — #2
When you use the jquery from www.technologistsinc.com, an authentication request appears which when cancelled results in no jquery library being loaded.
It appears that your code works though when I replace it with http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
tmacfarlane — 2010-05-11T08:21:52-04:00 — #3
Sorry about that. I've copied 1.4 out of the staging site, so the "tabs.html" file works as above. But that's not the problematic file--it is "index.html" that won't work-- when you click a link to anything but the default tab in "Tabs.html", that tab won't be active when you jump. What do I need to do to solve that (short of installing the UI, which is severe overkill)?
paul_wilkins — 2010-05-11T08:30:29-04:00 — #4
You will need a way for the page to know which tab to activate.
This is commonly done by giving the page body an identifier, so that from that id the script knows which tab to activate.
tmacfarlane — 2010-05-11T08:43:23-04:00 — #5
I think I understand. The link from "index.html" should find the target tab's index, right? That's how I did it in Spry... I just cannot figure out a syntax in jQuery.
Can anyone point me in the right track? Do I need to create an indexing array in "tabs.html"'s header script, or do I need to add a string in "index.html"'s URL that addresses the 'clicked' variable?
tmacfarlane — 2010-05-13T15:20:56-04:00 — #6