wintercounter wintercounter - 6 months ago 19
CSS Question

Translate animation fallback to position

Currently i'm using elements with

position: absolute
for transitions but i should use
translate
instead. How to achive a fallback when
translate
is not available?

Answer

Finally, what i was doing is that i checked if CSS3 features are supported with JS. If not, i've attached a .fallback class to the body so i can make separate rules as a fallback.i've added like the following:

#animdiv{
    transform: translate(0,100px);
}
.fallback #animdiv{
    top: 100px;
}
Comments