[jQuery] Re: jQuery(this + child) ?

2009-03-04 Thread Kenchu

jQuery(this).find("a").toggleClass("highlighted");

Works.


[jQuery] Re: jQuery(this + child) ?

2009-02-26 Thread Pappy

as an alternative, you could do something like:

jQuery(".class").click(function() {
jQuery(this).toggleClass("highlighted");
})

then, in your CSS

.class a {
color: black;
}
.class.highlighted a {
color: red;
}

On Feb 26, 7:40 am, Tze Yang Ng  wrote:
> Try the following:
>
> jQuery(".class").click(function() {
>   jQuery('a',this).toggleClass("highlighted");
>
> }
>
> Cheers
>
> ==
>
> On Thu, Feb 26, 2009 at 7:46 PM, Kenchu  wrote:
>
> > Is there a way to do what I describe in topic?
>
> > For example.
>
> > jQuery(".class").click(function()
> > {
> >        jQuery(this + "a").toggleClass("highlighted");
> > });
>
> > This doesnt work. What im trying to do is to select all the 
> > elements within this. Is it possible to achive that somehow?
>
> --http://ngty77.blogspot.com


[jQuery] Re: jQuery(this + child) ?

2009-02-26 Thread Tze Yang Ng

Try the following:

jQuery(".class").click(function() {
  jQuery('a',this).toggleClass("highlighted");
}

Cheers

==

On Thu, Feb 26, 2009 at 7:46 PM, Kenchu  wrote:
>
> Is there a way to do what I describe in topic?
>
> For example.
>
> jQuery(".class").click(function()
> {
>        jQuery(this + "a").toggleClass("highlighted");
> });
>
> This doesnt work. What im trying to do is to select all the 
> elements within this. Is it possible to achive that somehow?
>



-- 
http://ngty77.blogspot.com