jquery.ui.touch.punch.js脚本阻止了触摸设备上的输入功能 [英] jquery.ui.touch.punch.js script is preventing input functionality on touch devices

查看:206
本文介绍了jquery.ui.touch.punch.js脚本阻止了触摸设备上的输入功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

花了我一些时间,但是我发现由于使用touch.punch脚本在触摸设备上启用jquery UI拖动功能,我无法单击输入.任何熟悉此脚本的人都知道为什么会这样吗?该窗体实际上位于父对象的树下.有谁知道我可以覆盖或强制执行选择的方法吗?我将尝试绑定事件以立即将焦点集中在输入上,但也许有人在这里有见识?

It took me a little bit, but I figured out that I can't click on my inputs because of the touch.punch script I'm using to enable jquery UI drag functionality on touch devices. Anyone familiar with this script know why that might be? The form actually resides down the tree of the parent object. Does anyone know a way I can override or force through the selection? I'm going to try binding events that force focus to the input right now but maybe someone here has some insight?

推荐答案

对于任何可能使用非常方便的touch.punch hack遇到类似情况的人,只需将注意力集中在click事件上就可以了!

To anyone who might wind up here with a similar situation using the very handy touch.punch hack, simply forcing the focus through on a click event will work just fine!

$('.input').bind('click', function(){
    $(this).focus();
});

这篇关于jquery.ui.touch.punch.js脚本阻止了触摸设备上的输入功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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