javascript - Trigger touchmove event drag and drop -


hi need trigger touchmove event manually , pull element out of countainer on mobile device (phonegap, jquery-mobile)

$(elem).bind('touchstart', function(event) {         event.preventdefault();                           var target = event.target;         target = $(this);          //this example changes css position         target.css("margin-top", "50px");  });   elem.trigger('touchstart'); 

is there way setup event manually , trigger object event that?

var event = $.event( "touchstart", { pagex:200, pagey:200 } ); 

i using this drag , drop, author mentioned there no way interact js , recommended:

- call drag , drop listeners , give them event objects create or - trigger simulated pointer events interact sees them drag user.

any idea?

can't declare function outside bind() , call directly?

$(elem).bind('touchstart', handler); function handler(event) {     event.preventdefault();                       var target = $(event.target);      //do stuff pagex , pagey     target.css("margin-top", "50px");  }  handler({pagex:200, pagey:200, target:elem, preventdefault:function(){}}); 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -