Coming from Animate element transform rotate (Answer of Dyin) I still can't get it to work properly.
I want to fade in a div with jQuery .show(). This div is containing an img. Now I want that img to be zoomed in slowley with css transition and scale (not jQuery, because it is much smoother) at the very beginning of the .show() command.
In short: I want the div to fade in while the containing img is zooming (show and zoom at the same time). But I only manage to zoom after the .show() function is completed, like that:
$( this ).show(800, function(){
$( ".bullets" ).removeClass("wait");
$( this ).find(".csc-textpic-image img").removeClass("zoomout").addClass("zoomin");
});
If I position the .addClass() outside the function, the class is added in the source code, but the img isn't zooming at all, like this:
$( this ).find(".csc-textpic-image img").removeClass("zoomout").addClass("zoomin");
$( this ).show(800, function(){
$( ".bullets" ).removeClass("wait");
})
CSS:
.zoomin {
transition: 24s linear;
-webkit-transform: scale(1.4);
-moz-transform: scale(1.4);
-ms-transform: scale(1.4);
-o-transform: scale(1.4);
transform: scale(1.4);
}
.zoomout {
transition: 24s linear;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-ms-transform: scale(1);
-o-transform: scale(1);
transform: scale(1);
}
Any help will be higly appreciated!