[jQuery] Re: when use addclass and toggleclass

2009-05-12 Thread sveisvei
Hi Addclass(this): if class attribute doesnt contain this, then add this Toggleclass(this): if class attribute contains this, remove this, else add this. Cheers :) On May 11, 3:35 am, runrunforest wrote: > Hi, > > method addClass and toggleClass do pretty much the same thing, what is > the tr

[jQuery] Re: when use addclass and toggleclass

2009-05-10 Thread runrunforest
oh I understand thanks. On May 11, 8:40 am, Steven Yang wrote: > when you do addClass it literally only "add" the class to the element > when you do toggleClass it checks whether the element has the class or not, > if it does then it will "remove" the class if it doesnt then it will "add" > the

[jQuery] Re: when use addclass and toggleclass

2009-05-10 Thread Steven Yang
when you do addClass it literally only "add" the class to the element when you do toggleClass it checks whether the element has the class or not, if it does then it will "remove" the class if it doesnt then it will "add" the class