Comments (4)
This is an issue with the wheel, because while it rotates the circle is really a square because of the box model and I am finding that only SVG can really mask the shape properly and not leave any hit area. Still haven't resolved the event bubble, sort of took a step back from it.
from touchy.
from touchy.
If anyone has a similar issue what I've done is if it's spinning, hidden the items, and I am applying a background to the wheel container that shows during it so it's a faux way of doing things. I have several layers inside the wheel so whenever an option is clicked or selected and you go into another screen it applies a particular class to change the background... This is a suitable solution for now... but I guess I would still like to figure this plugin out. I do like Touchy. Now onto the SVG foreignObject piece.
from touchy.
Hi, you're not the first person to struggle with Touchy's event delegation issues.
The idea behind Touchy is that all events are actually registering listeners on the document, so when you say:
$('#wheel').bind('touchy-rotate', handleTouchyRotate);
Contrary to how it looks and normally operates, this bind() is actually setting up a listener on the document. When the event (for example, "touchmove") bubbles up to the document, a proxy event handler fires a custom event on the element you called bind() on.
But while this is great for working with a global environment where you might need to tell the difference between a swipe and a drag, it messes with our normal use of event delegation and bubbling.
Sometimes, this can be dealt with by adding additional calls to bind() for all the elements in the tree that you are concerned with. But this does not work in the case of Touchy's rotate event. Your example is making me wonder if it wouldn't be better to be able to declare what the ultimate target of the event should be, and then all child elements would bubble their events until that target is reached... I have some experiments in the other branches of the code, but I have yet to figure out the best solution.
Please see the other discussions on the issue tracker and other branches to see where this has gone so far.
#4
#5
https://github.com/HotStudio/touchy/tree/event-target
from touchy.
Related Issues (20)
- jQuery compatible 1.9/2.0 versions
- Touchy takes over events (or so I think) HOT 1
- Pinch and Drag within the same element HOT 1
- touchy-pinch on iPad not working for me HOT 9
- touch-swipe - Triggered only once HOT 1
- Click event HOT 1
- Images are missing in file drag-and-flick.html
- Will this plugin work on SVG elements? HOT 3
- [enhancement] Add missing bower.json.
- 'touchy-pinch' event is not fired on Nokia
- sending 'touchy-drag' Events to PHP HOT 1
- Bug with velictyThresh (easy-swipe) in test-pages
- tap not working
- Touchy.js doesn't work with jQuery 1.5.2 HOT 1
- wrong event target with useDelegation=false HOT 8
- preventDefault should be optional HOT 2
- Rotate doesn't seem to work in latest version of Chrome on Android HOT 3
- handleGestureChange touches = event.touches, HOT 16
- Drag and longpress confict HOT 1
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 touchy.