[jQuery] Re: Problems with $.addClass()

2008-05-04 Thread Eddie
Have you already considered toggling those classes? $('#some_div').toggleClass('new_class').toggleClass('defaultClass'); Maybe you'll have to rewrite the 'new_class' properties to keep some persistent styles. On 4 maio, 11:37, Liam Byrne <[EMAIL PROTECTED]> wrote: > An explicit "by id" style set

[jQuery] Re: Problems with $.addClass()

2008-05-04 Thread Liam Byrne
An explicit "by id" style setting will always override a class-level style setting unless you use !important. Any way that you could have the some_div as a class instead of an ID ? That way the most recent applied class will override the initial setting. Liam rene.olivo wrote: Hello, I ha

[jQuery] Re: Problems with $.addClass()

2008-05-04 Thread Karl Swedberg
Not sure why it doesn't work for you. Of course, I was using "#container" as an example. You would need to replace that with an actual ID of a containing element on your page. There's no reason it shouldn't work if you're identifying IDs and classes correctly. You could also modify the st

[jQuery] Re: Problems with $.addClass()

2008-05-04 Thread rene.olivo
Makes lots of sense but still doesn't work, I'll take it into account this next time I start a project. Thanks a lot. On May 3, 11:57 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote: > In general, IDs take precedence over classes for CSS style rules. One > thing you could do is refer to a containing

[jQuery] Re: Problems with $.addClass()

2008-05-03 Thread Karl Swedberg
In general, IDs take precedence over classes for CSS style rules. One thing you could do is refer to a containing element's ID in the style rule for the class. Something like this: #container .new_class { color: #FFF; } hope that helps. --Karl _ Karl Swedberg www.english