Comments (12)
I think this happens because there is event attached on scroll
for scale by default, which useful for desktop version. But for touch devices it is not useful completely, because on touch devices there is no mouse. So scale better to reattach to pinch
gesture instead.
I will create an example today later in sandbox to illustrate this approach.
from xzoom.
from xzoom.
from xzoom.
I'm sorry, really had a lot of work to do this week.
from xzoom.
Will try on this weekend.
from xzoom.
from xzoom.
I have added example with Hammer.js version 2, to xzoom-sandbox repository here: https://github.com/payalord/xzoom-sandbox/tree/master/Hammer.jsV2
Which available to check and test now from mobile by this link: https://payalord.github.io/xzoom-sandbox/Hammer.jsV2/
To fix scroll issue, it is required to use touchAction
, but unfortunately Hammers option touchAction
is not working as declared, I tested it several times, need to report them about that, but this is another story. The only thing right now that is matter is this:
Chrome 35+, IE10+ and soon FireFox, support the touch-action property. This property tells the browser how to handle touches on an element. It improves the detection and experience of the gestures a lot, because it can prevent scrolling of the page without any JavaScript has to be executed, which can be too late in some cases.
Hammer uses a javascript fallback for this property when needed, so it is working with non-supporting browsers too. Still, on some (unpopular) devices the fallback might not work as good as the native support.
So i fixed scroll by manually adding touch-action: pan-x
via jQuery to the required element on pan event.
Also this example is not prefect. Because the behaviour of how exactly must be done interaction with mobile gestures depends on developer preferences. In my example i decided to use approach like first tap is opening zoom, then pan available to move image inside zoom area and then second tap will close zoom.
from xzoom.
from xzoom.
I assume that issue is fixed.
from xzoom.
from xzoom.
@payalord and @Budapresst, it looks like this fix does not work on Android, only iOS. I tested with Chrome 42 under an older Android version. Zoom is initiated but you can't see the lens or move the lens around, it is stuck in the top left corner.
from xzoom.
Must be new version of hammer.js not working on old version of chrome. Need test with hammer.js v1.
from xzoom.
Related Issues (20)
- While i'm click the first time small preview it the there is that possible to hide this in mobile devices. HOT 3
- xZoom Lens is not adjusting in small size of image HOT 9
- xZoom lens in mobile HOT 5
- how can I make the zoom result image bigger than the container HOT 2
- rootOutput HOT 2
- Capturing current zoom scale HOT 1
- Page Not Scrolling HOT 1
- Module build failed: ModuleNotFoundError: Module not found: Error: Can't resolve '../images/xloading.gif' in 'C:\Users\fhsna\Projetos de software\lojafinal\loja\node_modules\xzoom\dist' HOT 3
- Add xzoom event on dynamic images HOT 2
- Is it possible to use it with Vue.js? HOT 10
- php laravel HOT 2
- Thumbnail image click not working HOT 1
- Lens is not working - overlapping lens frame on hover HOT 1
- Question - xzoom container size adjustability HOT 1
- i made the thumbnail in left side of the image like amazon but its throwing error in js HOT 2
- Zoom aspect ratio changes when adding image of the same size as of the demo car images HOT 2
- Either cursor is not working or Popup image window position is not right HOT 2
- Perfect plugin ,Why no arrows button HOT 1
- how can use in gulpjs file HOT 1
- Not working over modal HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xzoom.