jairajs89 / touchy.js Goto Github PK
View Code? Open in Web Editor NEWA simple light-weight JavaScript library for dealing with touch events
A simple light-weight JavaScript library for dealing with touch events
I want to see if this works; the demo is only in a downloadable zip file.
in order to try it with my iPad, I need to download it, upload it to my own host, then load up that url in my iPad. Can you set up a free hosting account somewhere to host the demo rather than just post it on github?
I can do this myself of course, but that means the next person has to do it too, and the next one....and the next one...
ad infinitum.
:)
Touchy is a great layer for implementing both touch (smartphones and tablets) and click (desktops) events in a webapp. I ran into a problem when testing a webapp of mine on Internet Explorer; the coordinates that the Touchy callback returns are 'undefined'.
Unfortunately Internet Explorer 8 and older versions still have a market share of over 20 percent, such a large group of users is hard to ignore. It would be great if Touchy supports Internet Explorer 8 as well!
I didn't see any way to do this from the docs or a brief look through the source code. Does touchy provide any way for an event handler to call preventDefault() on the underlying event object?
(I need this as a fix for http://code.google.com/p/android/issues/detail?id=19827)
After touching an activated element and constantly moving your finger without releasing for a minute or so, performance starts to degrade.
Touchy stores data for a touches entire lifespan until it is released. So upon release from the screen memory is cleared and performance is once again normal.
Simply don't store the entire touch lifespan and expose the data as it is generated so that developers can decide on their own wether or not they wish to store it.
Hi!
Binding Touchy.js on 40+ elements on iOS (iPhone 4) casues my webapps UI to hang for a few seconds. Using event delegation should speed things up.
Touchy(element, callback(hand, finger) {} );
could become:
Touchy(containerelement, cssSelector, callback(hand, finger, element) {} );
or something like
Touchy(containerelement, cssSelector, callback(hand, finger) {
// finger.element
} );
Hi,
when using the mouse:
mousedown starts triggering the move.
But if we leave the document without releasing the button, and release the button from outside the page, the page does not catch the release event, and when we come back to the element (with button released), the move are still triggered. This is quite confusing.
So, as a workaround, maybe you can cancel the move when mouse leaves an element.
Here is a quick patch I use to get a better behaviour
diff --git a/touchy.js b/touchy.js
index eee2f1e..75a4a62 100644
--- a/touchy.js
+++ b/touchy.js
@@ -386,6 +386,7 @@
if ( this.handleMouse ) {
bind(this.elem, 'mousedown' , this.mousedown() );
bind(this.elem, 'mouseout' , this.mouseup() );
bind(this.elem, 'mouseup' , this.mouseup() );
bind(this.elem, 'mousemove' , this.mousemove() );
}
When I try to use Touchy on my Transformer Prime, the touchend
event is never triggered, unless I only do a simple click-like touch. Once I move the finger, the touch never ends and the hand grows more and more fingers the more touchstart
events I trigger.
Using mouse simulation my code works fine though.
I've tried initializing Touchy with
Touchy(touchField, true, {
one: function(hand, finger){
console.log(hand.fingers.length);
}
});
to make sure that only one finger is used but that won't help either. The hand grows more and more fingers with every new touchstart
and never is a touchend
event triggered.
Hi, I was wondering if you had planed a way to test the App in the desktop? I.e. Faking the ipad movement with the mouse by holding keys or something? Thanks
latest wacom bamboo and intuos web plugin support code
http://www.wacomeng.com/web/index.html
(another demo here http://www.drawmore.net )
Apple MacBook or MagicPad
https://github.com/borismus/MagicTouch (from http://www.html5rocks.com/en/mobile/touch/ )
only missing one is "Logitech Wireless Touchpad", cannot find doc on broswer event handling
Hi,
on iPad, there is an error line 390 of touchy.js:
your code says:
this.fingers.splice(index, 1);
but this.fingers is undefined.
Instead, I wrote this:
mainHand.fingers.splice(index, 1);
and it solved the problem. But is it the right thing? And btw, why do you do a splice at this place?
Thanks for fixing this.
M.E.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.