[Javascript] hiding single td cells

Roger Roelofs rer at datacompusa.com
Tue Apr 25 09:07:25 CDT 2006


On Apr 25, 2006, at 9:34 AM, Steve Clay wrote:

> Another reason why classNames are the way to go if you can.

Yes!  Using class names is almost always a better way to go.  There  
are a few kinds of animation where setting class names is not  
flexible enough, but that is the exception, rather than the rule.   
Using class names allows you to define/test the look separately from  
the behavior which is a big win if you are on a tight deadline or  
have multiple developers involved.  Not to mention the boost in  
productivity.  When you add in the fact that you can have multiple  
classes attached to an object (ex: tr class="inactive selected  
whatever">) you gain tremendous flexibility.  Also, there are nice  
generic addClass/removeClass javascript functions out there that you  
can use to handle this.

I'm probably preaching to the choir here, but when I learned this  
technique it totally changed my scripting style.  The benefits of  
separating the look from the behavior have been huge for me.

Roger
-- 
Roger Roelofs                www.datacompusa.com
Datacomp Appraisal Services

"One accurate measurement is worth a thousand expert opinions"
     - Grace Hopper [1942]





More information about the Javascript mailing list