Reputation:
I'm trying to replace the eventtype with a custom eventtype...
$(function() {
$("#control").bind("myTouch", function(e) {
b = e.originalEvent.touches.length
});
$("#anothercontrol").bind("touchstart", function(e) {
a = e.originalEvent.touches.length
$("#control").trigger("myTouch"); }
});
});
a = the correct number and b = null??
Upvotes: 0
Views: 1240
Reputation:
Below seems to work (I guess it goes back to the way jQuery parses the touch events):
$(function() {
$("#control").bind("myTouch", function(e,event) {
b = event.touches.length
});
$("#anothercontrol").bind("touchstart", function(e) {
a = e.originalEvent.touches.length
$("#control").trigger("myTouch",e.originalEvent); }
});
});
Upvotes: 2