For some reason, I can’t use jQuery.
This is my code :
document.addEventListener("touchstart", function(e) {
e.preventDefault();
var orig = e.originalEvent;
var x = orig.changedTouches[0].pageX;
var y = orig.changedTouches[0].pageY;
//id("#draggable").css({top: y, left: x});
id("draggable").style.left = x;
id("draggable").style.top = y;
});
Using jQuery, you can get the originalEvent , but if you don’t use it, how to get it?
Thanks
If you have Safari on your desktop, open it in iPhone mode
Develop-> User Agent-> Mobile Safari...And put a breakpoint inside your function, the you can inspect the e object and all its properties.