michalsnik / aos

Animate on scroll library
MIT License
26.82k stars 2.6k forks source link

AOS causing horizontal scroll bar to appear #416

Open nom3d opened 6 years ago

nom3d commented 6 years ago

This is:

Specifications

Expected Behavior

No horizontal scrollbar

Actual Behavior

AOS causing horizontal scroll bar to appear when browser window is sized under 1000px or so.. seems to happen on the data-aos="fade-right" and data-aos="fade-left". When the container is say 800px wide and the browser is around 850-900 a horizontal scrollbar will appear until you scroll down and the effect is done.

Steps to Reproduce the Problem

1. 2. 3.

Detailed Description

Possible Solution

sGentiletti commented 6 years ago

overflow: hidden; for that container, and we can wait for the fix.

BuRTaRT commented 6 years ago

Yep,the same problem.

jbator commented 5 years ago

Same issue here. Usning bootstrap4 ".container-fluid" and rows with data-aos="fade-right" and data-aos="fade-left".

aronmeszaros commented 5 years ago

overflow: hidden; for that container, and we can wait for the fix.

or perhaps because fade-right and fade-left is the case, overflow-x: hidden; would be the best

tomihbk commented 5 years ago

Same problem.

mzvarik commented 5 years ago

This will never be fixed... this library should be erased and not used.

antonyleme commented 5 years ago

Not solved yet. I can't use overflow-x: hidden because the navbar goes out beyond the page

jonasmarco commented 5 years ago

Sadly, same problem here. I'd to use overflow-x:hidden on mobile to solve it.

nicolaskeller commented 5 years ago

overflow-x: hidden; on the body fixed it for me.

CaioSilvaWeb commented 5 years ago

I used overflow-x: hidden in the mother div and solved the problem, excellent library.

siemlohuis commented 4 years ago

Same for me on any size with text-align: center;

juliebam commented 4 years ago

I have this issue but only chrome and mobile. overflow-x:hidden doesn't seem to fix it. (its fine on firefox)

Ariansdf commented 4 years ago

overflow-x: hidden; on the body fixed it for me.

SAME HERE ! thanks ! that was a life saver !!! my div position is absolute, so it seems that the parent div overflow:hidden would not work ! (maybe ! not sure really why)

AliHussain85 commented 4 years ago

And what about the shadow of elements that get's hide due to overflow:hidden of parent div? Ca6pture

SaeedEsk commented 4 years ago

header, section { width: 100%; float: left; overflow: hidden; }

Ateyyah-Buthor commented 4 years ago

Well, for me the overflow: hidden thing worked only on desktop view.. but on mobile, I fixed it with something similar... My whole HTML body is divided into sections..

That's what I put in my CSS file -=And worked fine on mobile=- : section { overflow:hidden; }

volkandkaya commented 3 years ago

Body never worked, using overflow hidden on section was perfect.

Dulanka-K commented 3 years ago

overflow-x: hidden; in body alone didn't fix. Had to include following meta tag too

meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1.0, user-scalable=no"

edunwa302 commented 3 years ago

I used overflow-x: hidden in the mother div and solved the problem, excellent library.

works for me

766kadir commented 3 years ago

Firstly ı'm so sory for my bad lang. I've same problem. "overflow-x in aos". I many tried but ı finally find. I set css html, body max-width : 99%. In this way works it. Only loss %1 width. İf u dont worry for this, maybe u can use.

MetalxD117 commented 3 years ago

overflow-x: hidden; in body alone didn't fix. Had to include following meta tag too

meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1.0, user-scalable=no"

This absolutely works for my problem, thanks bro!!!!

ramapermadoni commented 3 years ago

overflow: hidden; for that container, and we can wait for the fix.

thank you very much, it works

Air-Sidney commented 3 years ago

Or you can begin animation from another side xD

San-tiago commented 3 years ago

overflow-x: hidden; in body alone didn't fix. Had to include following meta tag too

meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1.0, user-scalable=no"

this works for me, thanks buddy

Nwoye-Ezekiel commented 3 years ago

overflow-x: hidden; in body alone didn't fix. Had to include following meta tag too

meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1.0, user-scalable=no"

Thank you so much! it worked.

pkaustubh401 commented 2 years ago

overflow-x: hidden; in body alone didn't fix. Had to include following meta tag too

meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1.0, user-scalable=no"

This totally worked for me , only using overflow-x:hidden hides some elements of navbar so use the meta tag for complete working

Hydrodamalis commented 2 years ago

For this to work, add overflow: hidden to html.

html, body{ overflow: hidden}

nooroffical commented 2 years ago

.container { overflow: hidden; } add css only "container", not html or body. worked for me.

snowiewdev commented 2 years ago

i'm using vue with php, each page has a div with id=app, the following works for me:

body, #app { overflow-x: hidden; }

I guess it just needs to add a overflow-hidden class to a container that wraps around the elements with aos applied hope this helps

jessedmatlock commented 2 years ago

Unfortunate that this isn't resolved, still. I tried the meta name tag, no dice.. but, overflow-x: hidden on html and body resolved it. I've using a media query to only implement for mobile screens.

@media (max-width: 992px) { html, body { overflow-x: hidden !important; overflow-y: visible !important; } }

mRahulRoy commented 1 year ago

Not solved yet. I can't use overflow-x: hidden because the navbar goes out beyond the page

use overflow-x : hidden and this will solve your problem

mRahulRoy commented 1 year ago

use overflow-x : hidden and this will solve your problem

syedahmedrz commented 1 year ago

Perfect solution for that... recommended

Farhan100X commented 1 year ago

766kadir

Firstly ı'm so sory for my bad lang. I've same problem. "overflow-x in aos". I many tried but ı finally find. I set css html, body max-width : 99%. In this way works it. Only loss %1 width. İf u dont worry for this, maybe u can use.

Make it 99.9%. It solves the problem of AOS + you won't see any decrease in width. 766kadir Thanx

romulis commented 1 year ago

Overflow: hidden is great... unless you want to incorporate a css sticky element or have an element overlap another element, then not so great. overflow-x: clip works better than hidden and is compatible with css sticky element.

Mos3aB696 commented 1 year ago

To Solve This Don't Use ( flip-up | flip-down | zoom out ) And Another Values Going Greate

MozerBuce commented 1 year ago

I got the same problem using slide and i tried to change many things on the layout and nothing, for now i using this: overflow-x: hidden;

issam-seghir commented 1 year ago

overflow-x: hidden; for the parent div fix the problem

tutods commented 1 year ago

For me the meta tag doesn't work.

issatillie commented 1 year ago

Same issue here. Tried applying it to the body, no changes, to HTML & BODY, just made it literally impossible to scroll down on smaller devices, I literally could not scroll down. If I could, the AOS animations wouldn't play. It's terrible that this issue has been around since 2018! That's crazy.. even applying it to the containers didn't help, couldn't scroll down on smaller devices.

shreygargofficial commented 1 year ago

Hey Guys!!! I have fixed the issue for me just replaced zoom-out with zoom-in as zoom-out initially takes the space more than the parent container hope this would help

fabiviegas commented 1 year ago

I used overflow-x: hidden in the mother div and solved the problem, excellent library.

thanks bro!

tutods commented 1 year ago

Anyone having issues on Next.js? Like: Warning: PropclassNamedid not match. Server: "text-4xl font-bold tracking-tight text-white sm:text-6xl aos-init aos-animate" Client: "text-4xl font-bold tracking-tight text-white sm:text-6xl"

V4LKYR13101 commented 1 year ago

overflow-x: hidden; in body alone didn't fix. Had to include following meta tag too

meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1.0, user-scalable=no"

This is the full answer. overflow-x: hidden and the additional viewport section. Thank you Dulanka-K

elielson-and commented 6 months ago

✅Solved.

im using tailwind, so i just passed overflow-x-hidden on the main component (entire app), however if it doesn't work for your case. you can try adding it to the body instead of the main component. Additionaly to force it you can try: !important:

css: overflow: hidden !important;

Sivayogeith commented 1 week ago

overflow: hidden;

needed this, and the workaround works amazingly! i was about to give up lol.