-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix: disable skrollr on sm/xs viewport sizes #13
Conversation
snSkrollr.init(); | ||
if ($window.innerWidth > 1023) { | ||
snSkrollr.init(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah i think you should disable it for mobile, maybe link this logic to the ResizeService? But I don't know if skrollr has a function to disable and renable itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it has skrollr.destory()
so linking with the ResizeService could work.
👍 |
Fix: disable skrollr on sm/xs viewport sizes
Skrollr causes some issues on mobile. It is recommended to use
id=skrollr-body
on the scrollable element, skrollr then disabled native scrolling and uses css transforms. However as our menu and projects overlay areposition: fixed
this causes issues. Theposition: fixed
elements can be set outside theskrollr-body
however they are still not scrollable, as skrollr disables native scrolling on mobile (in favour of a css transforms method).As we aren't actually using skrollr on mobile/tablet at the moment anyway (atm it is used only for the soon logo in desktop view) I have disabled skrollr initialisation if the viewport is smaller than 1024.