0
I want to replace the 'product' class with the 'product' class with javascript, as soon as I pass the mouse through the div. How do this code?
Js
$(function(){
$(".produto").hover(
function(){
//Ao posicionar o cursor sobre a div
$(this).addClass('produtocomprar');
},
function(){
//Ao remover o cursor da div
$(this).removeClass('produtocomprar');
}
);
Css
.produto {
position: relative;
width: 190px;
height: 340px;
margin-left: 40px;
margin-top: 20px;
float: left;
display: flex;
flex-direction: column;
background-color: #ffffff;
}
.produtocomprar {
position: relative;
width: 200px;
height: 340px;
margin-left: 40px;
margin-top: 20px;
float: left;
display: flex;
flex-direction: column;
background-color: red;
}