jmpressjs / jmpress.js

A jQuery plugin to build a website on the infinite canvas
http://jmpressjs.github.com/jmpress.js
1.5k stars 237 forks source link

How to prevent jmpress capturing touch events. #142

Open SkeLLLa opened 10 years ago

SkeLLLa commented 10 years ago

Hello. I use three.js component with camera controls inside jmpress slide. When I use mouse on PC, all works well and when I hold LMB and drag mouse it rotates my 3d object. But on tablet when I start touch in jmpress div it switches slide instead of rotating 3d object. If I start touch outside of jmpress container all works well.

I think that somewhere jmpress setting it's own handler on container element and preventing event bubbling to document element, where three.js bind it's own handlers.

So the question is how to prevent jmpress handling touch events at all?

sokra commented 10 years ago

Shoudn't three.js bind its touch events to the three.js container?

MiD-AwE commented 10 years ago

I use X3DOM and everything works as expected.

SkeLLLa commented 10 years ago

@sokra three.js container could be rather small, so it will be hard to put finger on it on devices with small displays. Also when three.js controls are binded to document we can rotate multiple 3d scenes simultaneously. As I said mouse works well, so I think only touch events are prevented. And also we actually don't need to switch slides on touch swipe, so by disabling we will kill two birds with one stone.

@MiD-AwE X3DOM is wonderful product, but unfortunately we need to support IE10 on windows rt and native iOS browser on iPads. So for now we're limited to three.js because it can work without webgl.

shama commented 10 years ago

@SkeLLLa Are you able to post an example online for us to check it out?

SkeLLLa commented 10 years ago

@shama Ok, I'll create jsfiddle to isolate issue tomorrow.

SkeLLLa commented 10 years ago

I've isolated issue http://skellla.bitbucket.org/jmpress/sample.html#/step-2 in this sample (jsfiddle refused to work correctly with jmpress or may be I'm just a noob). For now I can't see a part of issue. In isolated sample I can rotate my model with touch. So maybe issue is located somewhere in my app. I'll continue to investigate it.

But other part of an issue is still present. When I rotate my model with touch it also switches the slide after touchend. I don't need this, because in my app I shall have "back" and "forward" buttons or even slide switch will be controlled from remote machine via websockets on something like this. So I still looking for the solution for disabling slide switch via touch.

MiD-AwE commented 10 years ago

@SKeLLa Yeah that is my one qualm. I hope that the apple support works out too. As for IF 10, X3DOM uses a flash wrapper. But, I imagine in your situation no apple support is a deal breaker.