-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to disable animations on smaller screens? #72
Comments
Same problem here. On mobile the animations are annoying because they're triggered when the scroll has finished which leads to blank screens for a while - on iOS at least. |
This has come up a few times, and will be definitely be supported in Duplicate of #32 |
@julianlloyd Julian, thank you, dude! 🍻 |
@getimo @gr2m @maltheluda This is now baked in! window.sr = new scrollReveal({ mobile: false }) |
I'm using |
@thulioph I didn’t actually realize this, but… pulled straight from http://detectmobilebrowsers.com/about (where the regex comes from) So in order to include tablets as mobile, add |
Thanks @julianlloyd, but don't resolve my problem. |
I see. Well, I think I’ll be adding support for tablets in the near future. So perhaps by then, I’ll have prepared a solution for you. |
Is there any way to disable ScrollReveal animations on mobile devices but enable them on Tablets such or devices with viewport width of more than 992px ? |
@deepakya You can use Example: var mq = window.matchMedia( "(min-width: 992px)" );
var sr = new ScrollReveal();
var isMobile = sr.tools.isMobile();
// ScrollReveal should proceed if we’re not mobile,
// or if we’re mobile with a matching minimum width.
if (!isMobile || (isMobile && mq.matches)) {
sr.reveal('.foo', { reset: true });
// etc...
} The |
I hope I could just add this CSS
but it didn't do the trick (in latest Chrome). Do you have a suggestion?
The text was updated successfully, but these errors were encountered: