Re: [jQuery] $(node).hasClass(...) function

2007-03-05 Thread Klaus Hartl
John Resig schrieb: > .hasClass() would just use .is() (or jQuery.filter) internally. Right > now we're quickly gaining filesize without even adding new features > (only dealing with bug fixes). For now, .is() will have to suit. > > Another option would be to add an entry for .hasClass() in the >

Re: [jQuery] $(node).hasClass(...) function

2007-03-05 Thread Dominik Hahn
That'd be the best solution! Thanks for the code, I was using if($(this).attr('class').search('selected') != -1) { // code } before. :-) 2007/3/5, John Resig <[EMAIL PROTECTED]>: .hasClass() would just use .is() (or jQuery.filter) internally. Right now we're quickly gaining filesize without ev

Re: [jQuery] $(node).hasClass(...) function

2007-03-04 Thread John Resig
.hasClass() would just use .is() (or jQuery.filter) internally. Right now we're quickly gaining filesize without even adding new features (only dealing with bug fixes). For now, .is() will have to suit. Another option would be to add an entry for .hasClass() in the documentation, but in its detail

Re: [jQuery] $(node).hasClass(...) function

2007-03-04 Thread Paul Bakaus
Absolutely Karl - the is() method is wonderful, I use it quite often. But there are often more ways to achieve the same things, sometimes it's just a matter of taste. Anyway - a hasClass method would probably even save a few ms compared to is() in my opinion, because you don't need to parse stuff.

Re: [jQuery] $(node).hasClass(...) function

2007-03-04 Thread Karl Swedberg
Maybe .hasClass() would be helpful, but keep in mind that .is() offers /more/ functionalities than .hasClass() would. For example ... $('.class').is('#my-id') $('p').is(':visible') $('div').is('[a]') I'm not necessarily opposed to having .hasClass(), but I really love the flexibility of .is

Re: [jQuery] $(node).hasClass(...) function

2007-03-04 Thread Paul Bakaus
Hi guys, I think it's absolutely worth thinking about adding a hasClass shortcut to the core, since I also missed the shortcut many times. the is() function is pretty nice, but people would really guess there is a hasClass. -Paul 2007/3/4, Sébastien Pierre <[EMAIL PROTECTED]>: Hi, This is no

Re: [jQuery] $(node).hasClass(...) function

2007-03-04 Thread Sébastien Pierre
Hi, This is not very obvious, and I guess some people won't notice that "is" offers the same functionalities as a potential "hasClass"... from a "developer friendly" point of view, I think it would be better to have addClass/toggleClass/hasClass rather than addClass/ toggleClass/is. Just m

Re: [jQuery] $(node).hasClass(...) function

2007-03-02 Thread Microtoby
Sorry when I reading John Resig's reply... -Original Message- From: Microtoby [mailto:[EMAIL PROTECTED] Sent: 2007年3月3日 3:44 To: 'jQuery Discussion.' Subject: RE: [jQuery] $(node).hasClass(...) function Yes, I'm think this function very usefull, but jquery only has

Re: [jQuery] $(node).hasClass(...) function

2007-03-02 Thread Microtoby
bject: [jQuery] $(node).hasClass(...) function Hi all, I was wondering if somebody would be interested in a hasClass(...) function for jQuery. I would definitely find it useful, and am willing to contribute it. -- Sébastien ___ jQuery mailing list di

Re: [jQuery] $(node).hasClass(...) function

2007-03-02 Thread John Resig
give this a try: $(node).is(".class") --John On 3/2/07, Sébastien Pierre <[EMAIL PROTECTED]> wrote: > Hi all, > > I was wondering if somebody would be interested in a hasClass(...) > function for jQuery. I would definitely find it useful, and am > willing to contribute it. > > -- Sébastien > >

Re: [jQuery] $(node).hasClass(...) function

2007-03-02 Thread Kelvin Luck
You can use: $(node).is('.className') Sébastien Pierre wrote: > Hi all, > > I was wondering if somebody would be interested in a hasClass(...) > function for jQuery. I would definitely find it useful, and am > willing to contribute it. > > -- Sébastien >

[jQuery] $(node).hasClass(...) function

2007-03-02 Thread Sébastien Pierre
Hi all, I was wondering if somebody would be interested in a hasClass(...) function for jQuery. I would definitely find it useful, and am willing to contribute it. -- Sébastien ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss