Grow your CSS skills. Land your dream job.

help with some jquery

  • # May 20, 2012 at 8:24 pm

    I am trying to figure out how to get the background of the hovered anchor tag to turn the span.number background red. Right now when I hover, it turns them all red. I only want the one that is hovered on red. So if you hover on a category, it will turn the category color red as well as the background of the number to the right red.

    http://jsfiddle.net/fPj52/3/

    # May 20, 2012 at 8:51 pm

    Maybe list each one as an individual class and call the class?

    $(#span).onMouseOver(function(){
    $(#span.number.one).css(‘red’);
    });

    # May 20, 2012 at 8:57 pm

    that didn’t work

    # May 20, 2012 at 10:08 pm

    First off: your markup is wrong, more specifically the nesting:

  • Movies10
  • You close the first span, while the anchor is still open. I believe you want this:

  • Movies10
  • Also, I don’t really see the point of putting each line in a separate UL and then have two LI’s in there. I think you’d be better off with one UL, with 4 LIs that each contain two spans, but anyway, that’s not what this issue is about.

    Here’s something that you should be able to use: http://jsfiddle.net/fPj52/27/

    # May 20, 2012 at 10:22 pm

    My multiple ul’s made more sense in an earlier version of my code. Now I see that it does make more sense to get rid of them and have just the one.

    Thanks for the code. That is what I was trying to accomplish

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

You must be logged in to reply to this topic.

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