I have a code in jquery that does the following, it creates a class after the hover, until it is working normally, but since I will have to replicate this action in other places but will change the css properties of each section, in the case are four, but I did not want to have to keep replicating the same code several times, does anyone know a way to improve this code so it does not get repetitive?
$('.bg_hover').hover(
function(){
$(this).addClass('ativo');
},
function(){
$(this).removeClass('ativo');
}
);
$('.bg_hover_dois').hover(
function(){
$(this).addClass('ativo_dois');
},
function(){
$(this).removeClass('ativo_dois');
}
);