Usual use of tabsView Source<div id="usual1" class="usual">
<ul>
<li><a href="#tab1" class="selected">Tab 1</a></li>
<li><a href="#tab2">Tab 2</a></li>
<li><a href="#tab3">Tab 3</a></li>
</ul>
<div id="tab1">This is tab 1.</div>
<div id="tab2">More content in tab 2.</div>
<div id="tab3">Tab 3 is always last!</div>
</div>
<script type="text/javascript">
$("#usual1 ul").idTabs();
</script>
This is tab 1.
More content in tab 2.
Tab 3 is always last!
Example of selecting default tabView Source<div id="usual2" class="usual">
<ul>
<li><a href="#tabs1">Tab 1</a></li>
<li><a href="#tabs2" class="selected">Tab 2</a></li>
<li><a href="#tabs3">Tab 3</a></li>
</ul>
<div id="tabs1">This is tab 1.</div>
<div id="tabs2">More content in tab 2.</div>
<div id="tabs3">Tab 3 is always last!</div>
</div>
<script type="text/javascript">
$("#usual2 ul").idTabs("tabs2");
</script>
This is tab 1.
More content in tab 2.
Tab 3 is always last!
Example of javascriptless useView Source<div class="usual">
<ul class="idTabs">
<li><a href="#idTab1">Tab 1</a></li>
<li><a href="#idTab2">Tab 2</a></li>
<li><a href="#idTab3" class="selected">Tab 3</a></li>
</ul>
<div id="idTab1">This is tab 1.</div>
<div id="idTab2">More content in tab 2.</div>
<div id="idTab3">Tab 3 is always last!</div>
</div>
This is tab 1.
More content in tab 2.
Tab 3 is always last!
Now there is more freedomView Source<ul id="freedom" class="idTabs">
<li>Freedom</li>
<li><a href="#one" class="selected">First</a></li>
<li><a href="#two">Second</a></li>
<li><a href="#three">Third</a></li>
<li><a href="#four">Fourth</a></li>
</ul>
<div class="tabContainer">
<h3>Tab Container</h3>
<p id="one">This is my first tab.</p>
<p id="two">This is my second tab.</p>
</div>
<img id="three" src="jquery_logo.gif" alt="Even images can be a tab">
<span id="four">Message four over here!</span>
Tab Container
This is my first tab.
This is my second tab.
Message four over here!
Break out of the traditional listView Source<div class="imagebox idTabs">
<a href="#img1" class="selected">1</a>
<a href="#img2">2</a>
<a href="#img3">3</a>
<a href="#img4">4</a>
<img id="img1" src="http://www.sunsean.com/images/symbol/_brace.png">
<img id="img2" src="http://www.sunsean.com/images/symbol/_lambda.png">
<img id="img3" src="http://www.sunsean.com/images/symbol/_beta.png">
<img id="img4" src="http://www.sunsean.com/images/symbol/_paren.png">
</div>
<script type="text/javascript">
$(".imagebox").idTabs("!mouseover");
</script>
Strange arguments and url changingView Source<div id="adv1" class="usual">
<ul>
<li><a href="#t1">Tab 1</a></li>
<li><a href="#t2" class="selected">Tab 2</a></li>
<li><a href="#t3">Tab 3</a></li>
</ul>
<div id="t1">This is tab 1.</div>
<div id="t2">More content in tab 2.</div>
<div id="t3">Tab 3 is always last!</div>
</div>
<script type="text/javascript">
var settings = { start:1, change:false };
$("#adv1 ul").idTabs(settings,true);
</script>
This is tab 1.
More content in tab 2.
Tab 3 is always last!
AnimationView Source<div id="adv2">
<ul>
<li><a href="#ani1" class="selected">1</a></li>
<li><a href="#ani2">2</a></li>
<li class="split"></li>
<li><a href="#ani3">3</a></li>
<li><a href="#ani4">4</a></li>
</ul>
<span>
<p id="ani1" style="display: block; opacity: 0;">Click on the tabs to see a nice fade.</p>
<p id="ani2">You're not impressed?</p>
<p id="ani3">But it's so cool... in a nerdy way.</p>
<p id="ani4">Download idTabs and have your cake. You can eat it too.</p>
</span>
</div>
<script type="text/javascript">
$("#adv2").idTabs(function(id,list,set){
$("a",set).removeClass("selected")
.filter("[href='"+id+"']",set).addClass("selected");
for(i in list)
$(list[i]).hide();
$(id).fadeIn();
return false;
});
</script>
Click on the tabs to see a nice fade.
You're not impressed?
But it's so cool... in a nerdy way.
Download idTabs and have your cake. You can eat it too.
Custom functionsView Source<span id="adv3">
<a href="#cake" class="selected">Cake</a> vs <a href="#pie">Pie</a>
<p id="cake">Cake is great</p>
<p id="pie">So is pie</p>
<div id="message">It's so delicous and moist!</div>
</span>
<script type="text/javascript">
$("#adv3").idTabs(function(id){
switch(id){
case "#cake": $("#message").html("It's so delicous and moist!"); break;
case "#pie": $("#message").html("Just the way mom makes it."); break;
} return true;
});
</script>
Cake vs Pie
Cake is great
So is pie
It's so delicous and moist!
Psst, here's beta copy of idTabs 3.0. Email me if you have questions. 
Version 2.2
Here's what's new.
- Changed option 'return' to 'change'
Removes confusion with javascript's return
- Added ability to dynamically add idTabs
The most requested feature
- Added 'selected' class option
More freedom rules!
- Added ability to change defaults
Now you can select no tab to be shown at start
- Bind idTabs to different event
Switching idTabs via !mouseover
- Auto-loading of dependencies
Cleaned up the code and added more comments
idTabs, the whatever plugin
idTabs is a plugin for jQuery.
It makes adding tabs into a website super simple.
But it can also open the door to endless possiblities.
Getting started is easy, just download the program above,
and copy and paste the following code into the <head>
<script type="text/javascript" src="jquery.idTabs.min.js"></script>
Now any <a href="#tab">
inside of an element with class="idTabs"
will show the element with id="tab"
. See below for a better example.
<ul class="idTabs">
<li><a href="#jquery">jQuery</a></li>
<li><a href="#official">Tabs 3</a></li>
</ul>
<div id="jquery">If you haven't checked out ...</div>
<div id="official">idTabs is only a simple ...</div>
If you haven't checked out
jQuery yet, I highly recommend it.
idTabs is only a simple implimentation of tabs. If you want advanced features like ajax tabs, then I highly recommend the official
Tabs 3 plugin.
Please let me know if you comments, questions, suggestions, rants, raves,
and anything else you can think of, about idTabs.