markgandolfo / jquery.tabbify

A simple tab plug, that will hold state when a user leaves the page/site

This URL has Read+Write access

markgandolfo (author)
Sun Jun 07 01:08:59 -0700 2009
commit  72bf31460626d2d5e22b344dbc89e7199d0a7b12
tree    1d8a0606462e88c9bb392660d4f00d94e6a1c4a2
parent  17767db1a137e35a69a276ce19cbeb85f1777d91
name age message
file jquery.tabbify-min.js Sun Jun 07 01:08:59 -0700 2009 added minified version [markgandolfo]
file jquery.tabbify.js Sun Jun 07 00:54:43 -0700 2009 initial commit [markgandolfo]
file readme.markdown Loading commit data...
readme.markdown

jQuery Tabbify Plugin

Tabbify extended simpletabs, it added the memory of the last tab. So if a user refreshes the window, moves away from the page, etc. it'll remember the last chosen tab.

You'll need

jQuery Cookie by Klaus Hartl/klaus.hartl@stilbuero.de

How to use

Obviously include the three libraries (jquery, cookie, tabify) then you can use it as so. Please name your overall id something different if you have more than one tabbed region per sites, as the div id will be the name of the cookie set to remember your last clicked tab

<script>
    $(document).ready(function(){
        $('#product_tabs').tabbify();
    });
</script>

<div id="product_tabs">
    <ul>
        <li><a href="#foo"><span>One</span></a></li>
        <li><a href="#bar"><span>Two</span></a></li>
        <li><a href="#wah"><span>Three</span></a></li>
    </ul>
    <div id="foo">
      First tab is active by default, its also known as the foo tab
    </div>
    <div id="bar">
        This is the bar tab
    </div>
    <div id="wah">
        This is the wah tab
    </div>
</div>
</pre>

Credits

Credit must go out to ANDREAS LAGERKVIST I've forked the original code.

and the creators of jquery.. FTW

And i guess i'll give myself a little bit of credit, after spending nearly a full day messing around with tab plugins, none did what i wanted, so i modified one! open source rocks.