Ok, there have been some changes, but I'll try to keep it easy, with an example, and there will be an included .zip file. First, you'll need the latest JQuery build, as well as the latest version of the Tabs Plugin. Pay attention to the pathing I have created in my code snippets here.
Include the necessary JavaScript libraries and CSS files:
2<script src="http://www.myserver.com/js/jquery/plugins/tabs/jquery.tabs.pack.js" type="text/javascript"></script>
3<link rel="stylesheet" href="http://www.myserver.com/resources/css/tabs/jquery.tabs.css" type="text/css" media="print, projection, screen">
4<!-- Additional IE/Win specific style sheet (Conditional Comments) -->
5<!--[if lte IE 7]>
6<link rel="stylesheet" href="http://www.myserver.com/resources/css/tabs/jquery.tabs-ie.css" type="text/css" media="projection, screen">
7<![endif]-->
8<script src="http://www.myserver.com/js/custom/jqTabsExample.js" type="text/javascript"></script>
9<link rel="stylesheet" href="http://www.myserver.com/resources/css/custom/jqTabsExample.css" type="text/css">
Next, layout your content. You'll notice that container elements have changed slightly from before.
2 <ul>
3 <li><a href="#half-frag"><span>Form 1</span></a></li>
4 <li><a href="#fragment-1"><span>One</span></a></li>
5 <li><a href="#fragment-2"><span>Two</span></a></li>
6 <li><a href="#fragment-3"><span>Tabs are flexible again</span></a></li>
7 </ul>
8 <div id="half-frag">
9 <form name="section-1" id="section-1" action="process.cfm" method="post" enctype="multipart/form-data">
10 <ul class="anchors">
11 <li><a href="#form1_step1"><span>Step 1</span></a></li>
12 <li><a href="#form1_step2"><span>Step 2</span></a></li>
13 <li><a href="#form1_step3"><span>Step 3</span></a></li>
14 </ul>
15 <div id="form1_step1" class="frmStep">
16 Field 1: <input type="text" name="field1" id="field1" />
17 </div>
18 <div id="form1_step2" class="frmStep">
19 Field 2: <input type="text" name="field2" id="field2" />
20 </div>
21 <div id="form1_step3" class="frmStep">
22 Field 3: <input type="text" name="field3" id="field3" /><br />
23 <input type="submit" name="submit" id="submit" value="Post Form" />
24 </div>
25 </form>
26 </div>
27 <div id="fragment-1">
28 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
29 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
30 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
31 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
32 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
33 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
34 </div>
35 <div id="fragment-2">
36 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
37 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
38 </div>
39 <div id="fragment-3">
40 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
41 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
42 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
43 </div>
44</div>
Your end result should look a little like this:
The files (minus the js libraries) should be included in the Download below. Next time out I'll do the same with JQuery and the ExtJS UI Library.


#1 by wheezer on 6/18/07 - 9:49 PM
I haven't fully tested, but the nesting looks perfect, assuming this isn't a single instance of nest that is too ID dependent. Will I be able to create a 2nd nest on the same page?
Konqueror/Ubuntu fails completely. For a browser that is supposed to be so standards compliant, it only fails 90% of the time. Still, the problem is probably not great. The failure seems total, so it's probably just some detect issue?
#2 by Cutter on 6/18/07 - 11:35 PM
BTW, Klaus is a great help, and is quick to answer questions regarding the plugin.
#3 by Cutter on 6/18/07 - 11:54 PM
#4 by ctraos on 12/5/07 - 9:03 AM
#5 by paul Prusha on 1/12/08 - 7:21 PM
#6 by Gene on 1/30/08 - 4:54 PM
Tabs Plugin conflicts with IE and smartmenus, but not FF. sure would be nice to have a workarund.
BTW, i visit nashville to visit family from time to time.
.
#7 by Steve 'Cutter' Blades on 2/4/08 - 9:42 PM
We had very similar issues with using swfobject and JQuery. Basically, swfobject would programatically break IEs DOM when it rendered a Flash movie. This took quite a bit to discover, and even more to replace swfobject within our code. Chance are that you are running into a very similar issue.
#8 by Steve 'Cutter' Blades on 2/4/08 - 9:44 PM
#9 by sumit on 4/10/08 - 1:05 PM
thanks
#10 by okoy on 6/27/08 - 11:46 AM
#11 by Helena on 6/29/08 - 5:08 AM
#12 by x on 7/10/08 - 10:22 PM
thank u for gr8 post, but do there any way to mix or duplicate form1 again ? for ex. to be form1 & form2 & one and two tabs ? i try but i failed :(
#13 by brenda on 7/25/08 - 7:37 PM
#14 by M@rtijn on 7/26/08 - 5:20 AM
#15 by Kay on 8/25/08 - 4:11 AM
#16 by Boobe on 9/4/08 - 9:47 AM
#17 by Edder on 9/17/08 - 12:50 AM
#18 by Emma on 9/18/08 - 11:31 AM
#19 by Jason on 9/29/08 - 3:17 PM
How can one move the <form> tag?
Also, the <ul> must be inside a <form> tag of they dont render right either.
-Jason
#20 by Steve 'Cutter' Blades on 9/29/08 - 7:47 PM
Yeah, I put this tutorial out back in June of last year, and JQuery has already changed significantly, so this example may no longer apply. While I love JQuery for basic DOM manipulation, I've found ExtJS's component library to be much more comprehensive and consistent, so I haven't modified these older tutorials to use the latest versions of the JQuery library.
#21 by Martin on 10/4/08 - 7:43 AM
#22 by Steve 'Cutter' Blades on 10/4/08 - 8:49 AM
Well, that may be because you're using PHP;) If you want to post your (JQuery) code I can try to help you figure it out. Also, the JQuery group on Google Groups is an extremely active list.
#23 by George on 11/18/08 - 4:24 PM
I am not sure if you are aware. The tutorial on JQuery Nested Tab Set
with Demo is quite educative. I am in the process of downloading the
demo so to view but some of the folders are blank. I wondering if there is anyway you could provide the complete download in those
folders.
Thanks you.
George
#24 by Navaneeth Kumar on 12/1/08 - 4:45 AM
#25 by Korsakov on 12/12/08 - 12:23 PM
#26 by Miguel on 12/17/08 - 1:19 PM
#27 by mcb on 2/1/09 - 8:55 AM
#28 by Steve 'Cutter' Blades on 2/2/09 - 9:53 AM
The above is working fine for me. You can click on the tabs, etc. This example was also written a year and a half ago, and JQuery (and different plugins) has changed quite a bit, so I have no idea if this would work with 1.3.
#29 by johan on 2/8/09 - 9:56 PM
http://www.stilbuero.de/jquery/tabs_3/nested.html
#30 by anand on 3/19/09 - 11:04 AM
Till now i was trying to iniitialise the two tabs individually and the nested div was not at all correctly shown inside its container.
I had used $("#container").tabs() previously but in vain for nested divs. Changing that to $("#containder ul").tabs() solved the issue
#31 by lhao on 4/24/09 - 5:50 AM
#32 by jon on 5/1/09 - 1:29 PM
#33 by TuVinhSoft on 7/23/09 - 4:29 PM
#34 by Lennart on 7/31/09 - 9:49 AM
Thank you, I might use this one for my further projects...
#35 by yurukai on 8/22/09 - 9:06 AM
I am studying JQuery ..o(?_?)o... Thanks !
#36 by Joe on 9/29/09 - 9:38 PM
#37 by Sue on 10/14/09 - 4:44 PM
#38 by Steve 'Cutter' Blades on 10/14/09 - 4:50 PM
You are absolutely right, JQuery has changed a great deal since I wrote this. I'll also agree with you about ExtJs. There's a nested tab demo for Ext on this site too (also out of date).
#39 by petkim on 10/31/09 - 8:05 AM
#40 by Araba Oyunlar? on 11/1/09 - 6:17 PM
#41 by Hosting on 11/30/09 - 1:35 PM
#42 by mario on 1/6/10 - 8:53 PM
#43 by awtor on 3/6/10 - 4:30 PM
#44 by salma on 3/14/10 - 5:48 AM
#45 by Medyumlar on 5/10/10 - 4:17 AM
#46 by Bedava on 7/31/10 - 7:04 AM
#47 by medyum hoca cenap on 10/19/10 - 3:08 PM
#48 by donhasatrone on 11/28/10 - 5:05 PM
#49 by Pandiyan on 12/24/10 - 2:10 AM
#50 by Steve 'Cutter' Blades on 12/24/10 - 9:58 AM
#51 by araba yar??? on 1/2/11 - 12:12 PM
#52 by çiftlik oyunlari on 2/11/11 - 7:58 AM
#53 by Ken R. on 3/10/11 - 2:44 PM
#54 by Duck games on 4/5/11 - 8:44 AM
#55 by clamou on 4/29/11 - 1:51 AM
if i have in same page other link, and when i click in one of them it open a new tab with its name.
how u do this
#56 by Steve 'Cutter' Blades on 4/29/11 - 6:26 AM
http://jqueryui.com/demos/tabs/#method-add
There is, on that page, a simple example, with source code, as well:
http://jqueryui.com/demos/tabs/#manipulation
#57 by Eloktavian on 5/6/11 - 2:39 AM
Very, Very Thx... It's Work on my website..
I Love u so much :D
#58 by Eloktavian on 5/18/11 - 10:23 PM
Can you help me to using this code to my blog http://jd-software.blogspot.com ? Very confused to my blog.
Can someone help me plix.....
Thanks b4.
#59 by the_tree on 6/15/11 - 3:29 PM
#60 by Steve 'Cutter' Blades on 6/16/11 - 7:28 AM
#61 by Araba Yarisi Oyunlari on 6/22/11 - 9:40 AM
#62 by Ricardo Rowe-Parker on 7/12/11 - 5:00 PM
Thank you for sharing this.
Why did you not include the tab files (which are critical) in the download file? That link is now dead, which makes this page is useless. If you could help me locate those files, then I can give this a shot and will be happy to give you credit for it and/or make a financial contribution.
Thank you,
Ricardo
#63 by Steve 'Cutter' Blades on 7/13/11 - 5:16 AM
This post is very old, and things have changed. Go pull JQueryUI for the tabs code, it'll get you where you want to go.
#64 by abi on 8/18/11 - 10:53 PM
Form 1 have sub tabs. In sub tabs "Step 3" i click the post form button, after post the form its come back to same tab (Step 3). How?
#65 by Steve 'Cutter' Blades on 8/19/11 - 6:32 AM
??? I'm not seeing it post and come back to tab 3. When I post the blog homepage loads. Then I have to come back to the post.
What is it that you are asking though? Do you want to know how to maintain state?
#66 by Ben Perin on 8/30/11 - 2:03 AM
This example seems to be working quite well for me. I'm sure it could even be customised to be more powerful but this tutorial has really helped me get 95% of the way to my goal. The only problem I have is when trying to link to a nested tab. I am developing a site for my company http://kaltechgroup.com/testing which has links to the appropriate tabs (the links are down the bottom). However when I link to the id on the appropriate page the links don't work properly. Eg If I try to link to the page http://kaltechgroup.com/services.php#data (which is linking to the 3rd option on the first nested tab it will load all the divs on the first tab. Wierd.
Then if I try to link to any of the ids on the second nested tab from another page it will open the first item on the first nested tab instead. If I then manually click on the second nested tab the id I originally selected will be highlighted. Is there a way to get around this. I am not sure what I would have to do to get this working.
Cheers,
Ben
#67 by Steve 'Cutter' Blades on 9/1/11 - 5:46 AM
The basics of what was layed out in this post haven't changed much, but this post is four years old, and things have changed quite a bit since then. It's best to review the documentation to see the best way to handle your situation. A quick review of the JQUI Tabs docs shows a 'select' method that might handle your purposes:
http://jqueryui.com/demos/tabs/#method-select
Though, if going into a nested tabset, remember to select the outer tabset first. Hope this helps.