I have three columns in one of this type
<td align="center" height="240" width="380" >
<img src="imagens/modelo3_thumbnail.png" alt="" class="imagemModelo">
</td>
In my JS, I want the user to place the mouse on top of the event, which causes the size of the image to grow:
$(".imagemModelo").hover(
function(){$(this).animate({'width': '372px', 'height':'224px'}, 100);},
function(){$(this).animate({'width': '362px', 'height':'214px'}, 100);}
)
However, I would like that when the user clicked on the image, it would remain the same 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 do not know what else to do. I saw some answers in stackoverflow in English but none of the solutions worked out the effect I wanted it to be. Could you help me?