animate-css / animate.css

🍿 A cross-browser library of CSS animations. As easy to use as an easy thing.
https://animate.style/
Other
80.84k stars 16.24k forks source link

Animate div on fixed position #1215

Closed vipera7 closed 3 years ago

vipera7 commented 3 years ago

Describe the bug A clear and concise description of what the bug is. I'm trying to animate a fixed div. The div is centered

<style>
.alert_return_msg{
    display: none;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    color: #FFFFFF;
    background: red;
}
</style>
<div id="alert_return_err" class="alert alert-danger alert_return_msg" role="alert">
    <div id="alert_return_message_err" class="alert_body">SOME TEXT</div>
</div>
<script>
animateCSS('#alert_return_err', 'slideInDown');
</script>

When the animation end, the div is automatically going to the center of the page horizontally. When the div is animated, its position is on the left.

eltonmesquita commented 3 years ago

Please, see #1117.