Hello i need touch screen event which works as mousewheel DOMMouseScroll
I making website like google maps and with touch event i need make functionality to zoom in and out..
Need works like this image:
Try this one:
https://github.com/se468/JavascriptGestureHandler
It will do both mouse and touch events depending on whichever device.
Edit:
Here I will put more detail as suggested.
In Javascript, there are "touchstart", "touchend", "touchcancel", "touchleave", "touchmove" events.
For example, if you have a DOM object like this:
<div id="target" style="width: 100px; height: 100px; background: #ff0"></div>
In Javascript you can attach events as following (same goes for other events):
$("#target").addEventListener("touchstart",function(e){console.log(e.changedTouches)},false);
so for pinch zoom, you'd want to check if e.changedTouches.length >= 2 inside the function.
Check the change in distance between those touch points when "touchmove" event occurs and that value should give the amount it should zoom-in and zoom-out.