[ACCEPTED]-add class to a div when hover another one (Javascript)-css

Accepted answer
Score: 23
$(document).ready(function() {     
    $('#second, #third').hover(function(){     
        $('#first').addClass('blue');    
    },     
    function(){    
        $('#first').removeClass('blue');     
    });
});   

0

Score: 3

Just replace $(this) with $("#div_id");

where #div_id is the id of the 1 div you're trying to change.

Score: 0
$(".toptab").hover(function(){

    $(this).addClass("current");
    $(this).find("ul").show();

},function(){

    $(this).find("ul").hide();
    $(this).removeClass("current");

});

0

More Related questions