Grow your CSS skills. Land your dream job.

jquery selecting class with $(this) problem?

  • # September 21, 2009 at 4:37 am

    Hi there,

    i have a little problem i ultimately want to solve. I’m building a little jquery color-hover-effect for my index-page in WordPress. I just want to animate the Title of the Blogposts on mouseover and mouseout. Works actaully great, however i have one little problem.

    As a matter of fact the post-class with the Title in it i’m working in with jquery gets multiplicated like 10 times on the index of my blog. Like any normal blog. Unfortunatley my title element consists of a div-element that carries a span-element with the actual title in it. So the one and only problem is, that i want to set the function to the DIV-element and animate ONLY the SPAN-element inside of it.

    So if do this piece of code…

    Code:

    …all span-elementes with the .h1-class get animated at the same time.
    Of course i don’t want that. However if i do this…

    Code:

    …my whole div with the class .complete_highlight_link gets another background-color. In this case only the current-hoverd element gets animated, so with "this" it would kind of work, however i don’t want to animate the whole div but the span inside of it.

    So now my question:
    Is there any way of doing kind of this?

    Code:

    How can i solve that problem??
    thank you

    # September 21, 2009 at 7:31 am
    Code:
    $(“.h1″, $(this)).stop().animate(

    It’s working!

    Rob
    # September 21, 2009 at 4:51 pm

    awesome work – well done :D

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".