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
>
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
.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
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.
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
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
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
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
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
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
>
>
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
>
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
12 matches
Mail list logo