Created
March 22, 2013 15:51
-
-
Save foo9/5222359 to your computer and use it in GitHub Desktop.
minimum tab jquery plugin (577 bytes)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function(a){a.fn.simpletab=function(){return this.each(function(){for(var b,c,d,e,f=a(this).find("a"),g=0,h=f.length;h>g;g++)c=a(f[g]),d=c.attr("href"),d=a(d),d.hide().bind("stactive stinactive",function(b,c){e=a(this),c=="#"+e.attr("id")&&("stactive"==b.type?e.show():e.hide())}),c.hasClass("active")&&d.show();f.click(function(){if(e=a(this),!e.hasClass("active")){a.event.trigger("stactive",[e.attr("href")]);for(var d=0,g=f.length;g>d;d++)b=f[d],c=a(b),b!=this?(c.removeClass("active"),a.event.trigger("stinactive",[c.attr("href")])):c.addClass("active")}})})}})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
html:
javascript: