Div doesn't show with mobile disable
See original GitHub issueThis is:
Bug
Specifications
- AOS version: 2.3.4
- OS: Windows
- Browser: Chrome
Expected Behavior
Remove animation for data-aos with config disable: mobile
Actual Behavior
Div with data-aos doesn’t show if mobile is disabled
Steps to Reproduce the Problem
in nuxt plugin
AOS.init({ disable: 'mobile})
in html
<div data-aos="fade-in"></div>
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8
Top Results From Across the Web
DIVs not Displaying as Block on Mobile - css - Stack Overflow
your problem is not that the divs won't display as blocks, but that some of your blocks are wider than the view-port. Share....
Read more >Div doesn't get hidden on mobile - CodeProject
Problem is that I want to disable user to scroll the website horizontally by himself. With 'overflow:hidden' it works for desktop size (if...
Read more >Display property - Bootstrap
Quickly and responsively toggle the display value of components and more with our display utilities. Includes support for some of the more common...
Read more >CSS- Div- Be Careful When You Size Your Divs
Be Careful When You Size Your Divs · Visible - Content may appear outside the DIV. · Hidden - Extra content doesn't display...
Read more >4 reasons your z-index isn't working (and how to fix it)
1. Elements in the same stacking context will display in order of appearance, with latter elements on top of former elements. · 2....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
A bit late to the party but here’s the workaround I’m using to disable AOS animation on smaller screen sizes only:
First, disable animation on the screen size of your choice in the
AOS.init
function:When you set the ‘disable’ prop it seems AOS will add
pointer-events: none
andopacity: 0
to yourdata-aos=*
elements, so you need to overwrite the AOS styles in a media query.For example, if you’re using
data-aos="fade-up"
, your custom CSS might look like this:Hi Guys, I was having the same issue. It was working fine on Desktop but the animation was not working on mobile. (iPhone + Safari Browser) I was testing on it. After researching I found few solutions like adding mobile disabled and overflow for html or body, nothing worked for me. Following solution worked for me. Instead of adding init function in a separate JS file, I had to add the following in the footer of my html file and it started working for me.