I want to make 'dragstart' work like a click. Example:
// 1. Get the click position
$('#foo').on('click',function(e){ alert(e.pageX+':'+e.pageY);}
// 2. Get dragstart position, nothing more
$('#foo').on('dragstart',function(e){ alert(e.pageX+':'+e.pageY);}
Thats what i want to achieve .
But ofcourse second example does not work, i dont know how to make it possible. Simply , I need to get the coords of point of dragstart.
I use jQuery Mobile also, so perhaps it has some methods that I can use? I'd like to achieve this without any other libraries, so pure jQuery would be best solution.
Why? The thing is, that sometimes users click on specific elements fast - and because of this, they fire dragstart event instead of click. And to exegute my function I need the position , where the event triggered.
EDIT:
I solved this problem using mousedown event instead of dragstart. Mousedown gives the coords of click properly , but it still would be nice to know is there a way to get the coords of dragstart.