I've tried to create some matrices animation lately. But I noticed something weird. The following code works differently on Firefox, Safari and Chrome :
@-moz-keyframes matrix
{
from
{
-moz-transform: matrix(-1.0, 0.0, 0.0, -1.0, 0.0, 0.0);
}
to
{
-moz-transform: matrix(1.0, 2.0, 3.0, 1.0, 0.0, 12.0);
}
}
@-webkit-keyframes matrix
{
from
{
-webkit-transform: matrix(-1.0, 0.0, 0.0, -1.0, 0.0, 0.0);
}
to
{
-webkit-transform: matrix(1.0, 2.0, 3.0, 1.0, 0.0, 12.0);
}
}
Is there a way to fix this problem ?
The Animation. reverse() method of the Animation Interface reverses the playback direction, meaning the animation ends at its beginning. If called on an unplayed animation, the whole animation is played backwards.
The reason for this is, display:none property is used for removing block and display:block property is used for displaying block. A block cannot be partly displayed. Either it is available or unavailable. That is why the transition property does not work.
Animating your Transforms When the mouse moves away the animation is reversed, taking each box back to its original state. If you think that's cool, realise that CSS Animation can be applied not just to the transforms, but also to other CSS properties including: opacity, colour and a bunch of others.
Even if you've assigned a keyframes rule to an element, it still may not appear to play if you haven't set an animation-duration. By default, a CSS animation cycle is zero seconds long. To override this, add an animation-duration rule to your targeted element with a seconds value, in the same block as animation-name.
It seems to be just a difference in the way Gecko and Webkit renders the matrix
function, which is why they still have the experimental vendor prefixes. I say there is no clean cut way of "fixing" this issue, as it is entirely up to the rendering engine, so you may just have to tinker with the values to get equivalent results.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With