From 5f4f247df0aa567cea33d3c8e1f43be5bea3264c Mon Sep 17 00:00:00 2001 From: John Resig Date: Fri, 29 Dec 2006 17:21:48 +0000 Subject: [PATCH] Added in some changes to class handling and some docs for jQuery.nth(). --- src/jquery/jquery.js | 49 ++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 7f7ef08d..2ce32e1f 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