2017-08-08 55 views
0

我想同時使用Animate.css的fadeInLeft和fadeInRight,但是當元素出現時,水平滾動變得比實際屏幕大小更大。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

回答

1

添加overflow-x:hidden;到你的身體CSS。

這不是一個理想的情況,但應該做的伎倆!這基本上告訴瀏覽器忽略任何溢出x軸(水平)的東西。如果你想使用水平滾動條,你需要一個不同的解決方案。

+0

它的工作原理,謝謝! – prezli

+0

沒關係,如果你感到高興,請接受爲答案,並點贊。 :) – Adam