[ACCEPTED]-add class to a div when hover another one (Javascript)-css
Accepted answer
$(document).ready(function() {
$('#second, #third').hover(function(){
$('#first').addClass('blue');
},
function(){
$('#first').removeClass('blue');
});
});
0
Just replace $(this)
with $("#div_id");
where #div_id
is the id of the 1 div you're trying to change.
$(".toptab").hover(function(){
$(this).addClass("current");
$(this).find("ul").show();
},function(){
$(this).find("ul").hide();
$(this).removeClass("current");
});
0
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.