#13037 closed bug (notabug)
On ipad safari event.pageX is undefined
Reported by: | Leon | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.8.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
bind("touchstart",function(event){
startX = event.pageX;
}
startX is undefined
Change History (7)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
e.flyDiv.bind("touchstart",function(event){
startX = event.pageX; startY = event.pageY;
});
attributes as clientX, offsetX are also undefined
comment:3 Changed 10 years ago by
I tried a test on click function, as follow:
e.flyDiv.bind("click",function(event){
startX = event.pageX; startY = event.pageY;
});
It just works!
comment:4 Changed 10 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
Touch Events don't have those properties; they're hidden behind an array of touches. Please ask for help on the forums or StackOverflow.
comment:5 Changed 10 years ago by
Thanks, Scott. But when I used version 1.6.4, touch events just had x/y properties, and all things go well. My project just crashed when I updated jQuery to v1.8.3(so I had to roll back to the old version). Can you check if x/y properties is hidden by jQuery?
comment:6 Changed 10 years ago by
Sounds like you need to use event.originalEvent.pageX
, since jQuery doesn't know anything about touch events it doesn't try to normalize them.
On ipad safari with jQuery1.6.4, it works well