Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Overscroll, Android and Touchevents #51

Closed
KingRial opened this Issue · 0 comments

2 participants

@KingRial

I am just opening this issues to talk about "Touchevents" and mobiles.
Right now overscroll is working really fine on iPad/iPhone mobiles because it uses the HTML5 css features "overflowScrolling".

Unluckily Android clients (until the latest realease) cannot use such feature and the library must use "touchevents" to handle the scrolling.

I succesfully used the touchevents to scroll.
There is still a little problem to understand a "simple click" was done; if such event occurs the event must not be stopped with preventDefault().

I still have to understand hot to fork/commit correctlu on github but I'd like to share this little solution which needs improvment.

just changed the "events" variable to add touch events:
events = {
drag: 'mousemove touchmove',
end: 'mouseup mouseleave click touchend touchcancel',
hover: 'mouseenter mouseleave',
ignored: 'select dragstart drag',
scroll: 'scroll',
start: 'mousedown touchstart',
wheel: 'mousewheel DOMMouseScroll'
},

and added a simple check in the drag function:
drag = function (event) {
//ADDED to handle Touch Events datas correctly
if(event.originalEvent.touches){
event.pageX=event.originalEvent.touches[0].pageX;
event.pageY=event.originalEvent.touches[0].pageY;
}
//End ADD
event.preventDefault();
var data = event.data,
etc... etc...

Hope this code can be of some use for other people.

Riccardo "Rial" Re

@azoff azoff closed this issue from a commit
Jonathan Azoff Merge branch 'master' of github.com:KingRial/Overscroll into 1.6.2. M…
…erges #53 and Closes #51.

Conflicts:
	jquery.overscroll.js
ff58566
@azoff azoff closed this in ff58566
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.