1
I got three columns in one of these
<td align="center" height="240" width="380" >
<img src="imagens/modelo3_thumbnail.png" alt="" class="imagemModelo">
</td>
In my JS, I want that when the user positions the mouse on top, call the event that makes the image size grow:
$(".imagemModelo").hover(
function(){$(this).animate({'width': '372px', 'height':'224px'}, 100);},
function(){$(this).animate({'width': '362px', 'height':'214px'}, 100);}
)
However, I would like when the user clicked on the image, that one kept the size, so I added the following after the Hover call:
.click(function(e){
$(".imagemModelo").off("hover");
ativaItemModelo($(this));
e.preventDefault();
}
);
function ativaItemModelo(modelo){
modelo.css("width","372px");
modelo.css("height","224px");
}
However it is not working, when the user takes the mouse it returns to normal size. I don’t know what else to do. I saw some answers on stackoverflow in English but none of the solutions worked out in the effect I wanted it to stay. Could you help me?
@Renan-Kaic-Lopes, you managed to solve the problem with the answer ?
– Rafael Marcos
I got Rafael. I manipulated his code to adapt with what I needed and I was able to do exactly what the boss wanted. Thank you very much!
– WitnessTruth