From: John Resig Date: Fri, 29 Dec 2006 17:21:48 +0000 (+0000) Subject: Added in some changes to class handling and some docs for jQuery.nth(). X-Git-Url: http://git.asbjorn.biz/?a=commitdiff_plain;h=5f4f247df0aa567cea33d3c8e1f43be5bea3264c;hp=666cc900643ac0779b5d1afd132b23d97f7f09e0;p=jquery.git Added in some changes to class handling and some docs for jQuery.nth(). --- diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 7f7ef08..2ce32e1 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -1235,28 +1235,21 @@ jQuery.extend({ }, className: { - add: function(o,c){ - if (jQuery.className.has(o,c)) return; - o.className += ( o.className ? " " : "" ) + c; + add: function( elem, c ){ + if ( jQuery.className.has( elem, c ) ) + return; + elem.className += ( elem.className ? " " : "" ) + c; }, - remove: function(o,c){ - if( !c ) { - o.className = ""; - } else { - var classes = o.className.split(" "); - for(var i=0; i