Hi there
I'm pretty new to jquery/javascript, and I can't answer this question for myself.
The thing I want is to change a class of an object (toggleClass) when hovering the parent-element.
Now; I can hover the parent, but then I want to apply the function to a child of it.
- $('.parentclass').hover(
- function () {
- $(this.childclass).toggleClass('new-class-for-child');
- },
- function () {
-
- }
- );
of course this code does not work.
the 'this.childclass' of course does not select the right object.
Now I wanted to know how I select the child of the hovered parent correctly.
I tried things like
- $(this).find('.childclass');
but unfortunately this did not work either. somehow I have to many brackets there I believe.
Well I think for some of you this is just peanuts, but right now I just can't figure it out.
Thanks for helping me out.
Cheers