jQuery mobile- For every live tap event should there be an equivalent click event?

后端 未结 5 1159
Happy的楠姐
Happy的楠姐 2020-11-30 22:18

I have replaced the jQuery live click events to jQuery mobile tap events to increase responsiveness.

I have a feeling this was a bad idea for compatibility reasons.<

5条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-30 22:51

    Billy's answer is incredibly complete and actually worked quite well the few times I used it. Additionally however, you may want to look at the vmouse plugin in JQuery Mobile, it is an attempt to abstract mouse events:

     // This plugin is an experiment for abstracting away the touch and mouse
     // events so that developers don't have to worry about which method of input
     // the device their document is loaded on supports.
    

    -- https://github.com/jquery/jquery-mobile/blob/master/js/vmouse.js

    I've been playing with it on a project I'm working on, it seems pretty responsive these days. To use, something like:

    $('selector').bind('vclick', function () { ...
    

    or

    $('selector').bind('vmousedown', function () { ...
    

提交回复
热议问题