Jquery点击事件在设备上无法使用(ipad,iphone ..) [英] Jquery click event not working on li in devices(ipad, iphone..)

查看:161
本文介绍了Jquery点击事件在设备上无法使用(ipad,iphone ..)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Jquery点击事件在设备上的li上不起作用。我尝试使用点击和touchstart事件,但是使用touchstart时的问题是我无法向下滚动div。当我尝试通过点击li向下滚动时,它被选中。有没有办法使用任何jquery事件来选择和滚动li,而不是jQuery的移动事件?

Jquery click event is not working on li in devices. I tried using click and touchstart events, but the problem when touchstart used is I couldn't scroll down the div. When I try to scroll down by clicking an li, it gets selected. Is there any way to select and scroll li using any jquery events rather than jquery mobile events?

$('#liId').on({ 'touchstart' : function(){ console.log('Event Fired'} });


推荐答案

当我向所有的li添加了一个样式类时,问题就解决了。

The issue is solved when I added a style class to all li.

.liClass {cursor:pointer;}

.liClass { cursor : pointer; }

这篇关于Jquery点击事件在设备上无法使用(ipad,iphone ..)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆