标签在jqtouch中无法点击 [英] label not clickable in jqtouch

查看:106
本文介绍了标签在jqtouch中无法点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用以下代码我无法点击jqtouch中的标签(在iphone模拟器和iphone本身上):

With following code I can not click on labels in jqtouch (on iphone simulator and iphone itself):

<ul class="rounded">
  <li>
    <label for="user_name">Name</label>
    <input type="text" name="user_name" id="user_name"/>
  </li>
</ul>

它在safari中运行良好,我也在jquery-mobile的演示中检查了它,它是在iphone模拟器上工作,所以问题接缝严格按照jqtouch。

It is working well in safari, I have checked this also in demo of jquery-mobile and it is working on iphone simulator, so problem seams to be strictly jqtouch specific.

推荐答案

感谢@Ivan我找到了更好的解决方案:

thanks to @Ivan I found better solution:

  $('label[for],input[type="radio"]').bind('click', function(e) {
    e.stopPropagation();
  });

此外它还修复了单选按钮。

Additionally it fixes radio buttons.

唯一的缺点是 - 它会停止传播,但在我的情况下它是可以的。

The only downside is - it stops propagation, but in my case it is ok.

这篇关于标签在jqtouch中无法点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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