I might argue that if you're having to add/remove 15 classes, that your time
could be better spent optimizing your display code.
 
 
andy

  _____  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Jonathan Sharp
Sent: Wednesday, September 19, 2007 11:55 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] PERFORMANCE TIP: removeClass()


Do not do:
$(...).removeClass('a').removeClass('b').removeClass('c');
 
Instead do:
$(...).removeClass('a b c');
 
Same applys to addClass()
 
I had 15 classes I had to remove and Firefox was a champ at chained
removeClass calls, IE was taking 760ms!
 
-js

Reply via email to