dahlsdata-tahira dahlsdata-tahira - 4 months ago 33
CSS Question

Prevent increasing window-width when sliding out - CSS3 animation

I am applying an animation at a

element. The animation slides the element into the viewport and slides it out again. My problem is, that when the element is leaving the viewport, the window-width is increasing. You can see that by the scrollbar at the bottom. How can I prevent that from happen? I want that the window keep its size.

Here is my HTML:

<div class="x1">
<div class="cloud"></div>

Here you can see the JSFiddle: https://jsfiddle.net/kh7bLdv5/5/

Thanks in advance!


Simply add overflow-x: hidden to your body tag.