Grow your CSS skills. Land your dream job.

Selecting a certain element from elements with same classnames

  • # June 7, 2013 at 3:49 am

    Hi.. I have a list of link boxes with same class names. I want to apply mouse over effect to each so that its child element will disappear when I hover. But my code actually applies it to all.. Please teach me a work around for this. Thanks

    # June 7, 2013 at 3:50 am

    Please post on http://codepen.io

    # June 7, 2013 at 4:07 am

    http://codepen.io/ajnoguerra/pen/qIDvz

    Please teach me…
    I currently have a sample of my jquery code that I’m trying to figure out.

    $(“.mainlinks”).hover(
    function () {
    //mouse in
    $(“#overlay”).stop().animate({
    height: “0”,
    opacity: “0”
    }, 400 );
    },
    function () {
    //mouse out
    $(“#overlay”).stop().animate({
    height: “130px”,
    opacity: “10”
    }, 200 );
    }
    );

    # June 7, 2013 at 4:31 am

    You don’t really need javascript for that: http://codepen.io/JamyGolden/pen/Auovn

    You may not have more than 1 ID per page, so I changed the HTML IDs to classes.

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

You must be logged in to reply to this topic.

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