-
Notifications
You must be signed in to change notification settings - Fork 16
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
mobile support #3
Comments
If you really want to go through the JavaScript route, then you should use listen to touch events: https://developer.mozilla.org/en-US/docs/Web/API/Touch_events But on mobile, pressing the display and moving your finger around already pans areas with scrollbars, so you probably don't need any library for that. |
My scenario is that I'm showing a pannable area in a popup modal. When I try to pan inside the modal with my mouse and dragging, it works fine, but with an ipad it doesnt. It tries to scroll the page rather than the content in the modal |
The app I am working on looks better on desktop sans-scrollbars. So, on desktop, I set <html class="no-touch">
...
<script>/*! no-touch uglified | https://gist.github.com/mhulse/4704893 */!function(o,n,c){("ontouchstart"in o||o.DocumentTouch&&n instanceof DocumentTouch||c.MaxTouchPoints>0||c.msMaxTouchPoints>0)&&(n.documentElement.className=n.documentElement.className.replace(/\bno-touch\b/,"touch"))}(window,document,navigator);</script> #canvas {
overflow: hidden;
-webkit-overflow-scrolling: touch;
scroll-behavior: smooth;
}
.touch #canvas { overflow: auto; } Though, let me asterisk the above statements with this comment: I just assumed |
do you know what modifications need to be made to get this to work on mobile devices?
The text was updated successfully, but these errors were encountered: