[jQuery] Re: .hasClass() not behaving as expected.

2009-02-11 Thread MiD-AwE
Thanks for the reply. I eventually removed the -color and -image for the css background. mkmanning wrote: In your code you're attaching the hover event to the anchor tags; in the sample html none of the anchors has a class (the class is on the parent li element). On Feb 8, 4:24 pm,

[jQuery] Re: .hasClass() not behaving as expected.

2009-02-09 Thread Leonardo K
I tested your code here and works fine. I just ident your code to look better. On Mon, Feb 9, 2009 at 00:05, mkmanning michaell...@gmail.com wrote: In your code you're attaching the hover event to the anchor tags; in the sample html none of the anchors has a class (the class is on the parent

[jQuery] Re: .hasClass() not behaving as expected.

2009-02-08 Thread mkmanning
In your code you're attaching the hover event to the anchor tags; in the sample html none of the anchors has a class (the class is on the parent li element). On Feb 8, 4:24 pm, MiD-AwE cr.midda...@gmail.com wrote: Please help, I've been wrestling with this for too long now. I've put together

[jQuery] Re: hasClass

2007-04-17 Thread Aaron Heimlich
if($(div).is(.foo)) { // do super cool stuff } On 4/17/07, Geoffrey Knutzen [EMAIL PROTECTED] wrote: How can I test if an element has a specific class? If I have div class=foo bar How can I check if the element has class=bar Seems like it should be easy, but I am having troubles.

[jQuery] Re: hasClass

2007-04-17 Thread Scott Sauyet
Geoffrey Knutzen wrote: How can I test if an element has a specific class? If I have div class=foo bar How can I check if the element has class=bar $(#myDiv).is(.bar); For all the great documentation JQuery has, some things are hard to find. This is at

[jQuery] Re: hasClass

2007-04-17 Thread spinnach
you could use the .is() function: $(element).is('.bar'); or if you need to access only elements with the .bar class you could use $('.bar').whatever()... $('div.bar') would be faster if you need only the divs with the .bar class.. dennis. Geoffrey Knutzen wrote: How can I test if an

[jQuery] Re: hasClass

2007-04-17 Thread Jeffrey Kretz
Have you tried $(element).is('.bar')? JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Geoffrey Knutzen Sent: Tuesday, April 17, 2007 10:01 AM To: jquery-en@googlegroups.com Subject: [jQuery] hasClass How can I test if an element has a

[jQuery] Re: hasClass

2007-04-17 Thread Scott Sauyet
I wrote: I don't know if I'm alone, but I think a plain alphabetic list of functions would be a good addition to the docs. Never mind. Just looking a little further, http://docs.jquery.com/Alternative_Resources -- Scott

[jQuery] Re: hasClass

2007-04-17 Thread Andy Matthews
Scott... www.jquery.com/api -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Scott Sauyet Sent: Tuesday, April 17, 2007 12:09 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: hasClass Geoffrey Knutzen wrote: How can I test

[jQuery] Re: hasClass

2007-04-17 Thread Geoffrey Knutzen
That does it. I had never looked at the is method before Thanks a bunch -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Brandon Aaron Sent: Tuesday, April 17, 2007 10:26 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: hasClass