Detect touch events in Chrome on Windows 8 with touchscreen

随声附和 提交于 2019-12-06 08:47:50

To get mouse and touch events working together on windows 8 chrome with touchscreen i had to:

1.add two events on one element "touchstart.owl mousedown.owl"

2.check "event.touches":

if(event.touches){
    x = event.touches[0].pageX
    y = event.touches[0].pageY
} else {
    x = event.pageX
    y = event.pageY
}

The simplest solution is to include Touch Punch plug-in http://touchpunch.furf.com/

I did it for my project and it works well - U can test it, here is my project: http://englishtotheworld.com/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!