animate.css icon indicating copy to clipboard operation
animate.css copied to clipboard

the class .slideInRight acts weird on mobile phone.

Open littlee opened this issue 11 years ago • 11 comments

qq 20150729214112

It create an extra area, because of that, user can scroll right and see an blank area. How to fix it?

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>Animate It</title>
    <link rel="stylesheet" href="animate.min.css">

    <style>
        div {
            background-color: orange;
        }
    </style>
</head>
<body>
    <div class="animated slideInRight">animate</div>
</body>
</html>

littlee avatar Jul 29 '15 13:07 littlee

overflow: hidden in your container... It's basic, if you translate or change the position of any element you're risking increase your page's dimensions. If you don't want this to happens, you'll have to use overflow hidden.

eltonmesquita avatar Jul 29 '15 13:07 eltonmesquita

It doesn't work. I tried to add it to body.

<body style="overflow:hidden;width:100%">

qq 20150729215809

littlee avatar Jul 29 '15 13:07 littlee

apply overflow:hidden to html too.

c9n avatar Jul 30 '15 07:07 c9n

Nice try. May I ask, should I remove all animation class after the animation finished?

littlee avatar Jul 30 '15 16:07 littlee

Nope. You may break something and won't gain in performance.

eltonmesquita avatar Jul 30 '15 20:07 eltonmesquita

@c9n you never want to apply css to the html tag unless youre SURE you want it to affect everything. use a surounding div.

procodeing avatar Aug 09 '15 19:08 procodeing

Just noticed this on the homepage of Animate. Definitely an issue.

lachlanjc avatar Sep 14 '15 22:09 lachlanjc

Not an issue.. This is the way the DOM works. If you get an element out of the visible canvas it doesn't cease to exist, it creates more space in the document (in this case, the page) and stay there. Animate uses translations to move the element. If the element break the document's boundaries while animating this will happen.

That's why there's the overflow property. It "masks" the area, but the leftover parts don't cease to exist...

Again, not an issue.

eltonmesquita avatar Sep 15 '15 12:09 eltonmesquita

Why the demo page remove class after animation finished? https://daneden.github.io/animate.css/ qq 20150916134633

littlee avatar Sep 16 '15 05:09 littlee

as far as i know, overflow hidden does not work with width 100%, it must be fixed (px) not "fluid"

kafeltz avatar Sep 16 '15 11:09 kafeltz

@littlee It wouldn't make sense to keep the classes as it have to re-animate the same element over and over with any different animation chose by the user.

In a real case scenario you could do this if you're chaining animations.

@kafeltz I never heard about this. Is it in the specs or is it a bug? I've never had any issue with it...

eltonmesquita avatar Sep 16 '15 17:09 eltonmesquita