label not clickable in jqtouch

前端 未结 5 1260
攒了一身酷
攒了一身酷 2021-01-14 11:40

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

相关标签:
5条回答
  • 2021-01-14 12:11

    There is an obscure trick for this, using CSS:

    label { cursor: pointer; }

    And it will work on iPhone and iPad.

    0 讨论(0)
  • 2021-01-14 12:15

    yeah, the user693942 CSS trick is enough, actually, it works!

    label { cursor: pointer; }
    
    0 讨论(0)
  • 2021-01-14 12:18

    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.

    0 讨论(0)
  • 2021-01-14 12:21

    add onclick="" to the label

    <label for="blah" onclick="">blah</label>
    
    0 讨论(0)
  • 2021-01-14 12:29

    Tapping on <label> does not auto-focus linked in Mobile Safari

    0 讨论(0)
提交回复
热议问题