3
Hello, I’m trying to make in Javascript a function that gives a zoom
very slow in my image, ie increasing my background-size
slowly, to give the impression of movement in the image.
I tried to do this function, but when running the site, I was without any success.
function zoomLento(){
var imagem = document.getElementById("imagem");
for (var i = 100; i <= 200; i++){
setTimeout(function(){
imagem.style.backgroundSize = i;
}, 10 * (i / 10))
}
}
uses the
this.is(":hover") = this.style.scale(2);
and in the css of atransition:scale Ns ease-in-out;
(only using Hover as an example, you can peacefully use other native attributes/properties/functions)– Murilo Melo
http://www.w3schools.com/css/css3_2dtransforms.asp
– Murilo Melo