Hi I need to trigger a touchmove event manually and pull an element out of the countainer on a mobile device (phonegap, jquery-mobile)
$(elem).bind('touchstart', function(event) {
event.preventDefault();
var target = event.target;
target = $(this);
//this for example just changes the css position obviously
target.css("margin-top", "50px");
});
elem.trigger('touchstart');
Is there a way to setup a event manually and trigger the object with that event like that?
var event = $.Event( "touchstart", { pageX:200, pageY:200 } );
I am using this for drag and drop, the author already mentioned there is no way to do this by interact js and recommended:
- call your drag and drop listeners and give them event objects that you create or - trigger simulated pointer events so that interact sees them as a drag by the user.
any idea?
Can't you declare the function outside the bind() and call it directly?