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

后端 未结 5 1167
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:35

    You can use the vmouse plugin from jQuery. This will resolve the 300ms delay on click events (mobile only) as well as cases where both click and touch events are triggered.

    To get just the vmouse plugin, use the jQuery Mobile Download Builder. Include it after jQuery but before any scripts that will depend on this plugin.

    The relevant event is vclick, basic use is as follows:

    $(".selector").on( "vclick", function( event ) {
        // To execute
    });
    

提交回复
热议问题