html - Animate.css 的 fadeInLeft & fadeInRight 同时

标签 html css animate.css

我想同时使用Animate.css的fadeInLeft和fadeInRight,但是当元素出现时,水平滚动变得比实际屏幕尺寸大。

让我告诉你我的意思。

每个元素都来自左右两侧,同时出现水平滚动。当元素彼此并排到达时,水平滚动就会消失。

enter image description here

我使用的代码:

HTML

<div class="tc">
    <div class="fl w-50">
        <div class="animate fadeInLeft">
        <img src="https://i.imgbox.com/Ism1Ekjf.jpg">
        </div>
    </div>

    <div class="fl w-50">
        <div class="animate fadeInRight">
        <img src="https://i.imgbox.com/Ism1Ekjf.jpg">
        </div>
    </div>
</div>

CSS

.tc { text-align: center; }
.fl { float: left; _display: inline; }
.w-50 { width: 50%; }

和 Animate.css 库:https://github.com/daneden/animate.css/blob/master/animate.css

最佳答案

添加溢出-x:隐藏;到你的 body CSS。

这不是一个理想的情况,但应该可以解决问题!这基本上告诉浏览器忽略任何溢出 x 轴(水平)的东西。如果你想使用水平滚动条,你将需要一个不同的解决方案。

关于html - Animate.css 的 fadeInLeft & fadeInRight 同时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45572721/

相关文章:

html - 具有不同内容高度的底部边距

html - 无法在 iPhone 中填写 HTML 表单,文本无法正常显示

javascript - ionic 框架 animate.css slideInUp 和 SlideOutUp 动画不工作

jquery - 动画不会显示隐藏 block

AngularJS ngAnimate让div从div顶部滑入,而不是页面顶部

javascript - Mozilla 在附加视频 src 后不会触发视频标签事件

javascript - 提交按钮不起作用。为什么?

html - 为什么 float 在 <div> 和 <p> 中表现不同?

html - 我怎样才能有一个渐变背景,它后面有一个纯色延伸到页面底部?

html - 使用 CSS 淡入背景颜色