Is there a way to replace all click listeners with listeners in jQuery and AngularJS?

I am sure you have heard a lot about this, but I cannot find a good solution.

Is there a way to exchange listeners clickfor touchendlisteners?

Since my iPad web application automatically adjusts to the screen, I don’t think that our users (anyway, anyway) will need to double-click to zoom, and the 300 ms wait is really fierce.

Can i do something like

$(document).click(function(e){
   e.preventDefault();
});
$(document).bind('touchend', function(e){
   e.currentTarget.click();
});

Or something similar that will affect the entire page / application around the world? Ideally, I would run this code only if I found features touchEventon the page. (Although touch-screen monitors with a mouse look mix things up ...)

Thanks in advance!

+4
4

AngularTouch (ngTouch).

, :

  • angularJS

  • angularTouch

  • JQuery

  • jqueryui ( draggable droppable)

  • jquery touchpunch ( )

: ( )

  • JQuery

  • jqueryui

  • jquery touchpunch

  • angularjs

  • Fastclick

!

0

, Silver-Bullet , ( ) .

, . : fastclick. , , 300 .

+2

include the ngTouch module in the module ( http://docs.angularjs.org/api/ngTouch ).

+1
source

As said in another question , you can use this code:

// List bound events:
console.dir( jQuery('#elem').data('events') );

// Log ALL handlers for ALL events:
jQuery.each($('#elem').data('events'), function(i, event){
    jQuery.each(event, function(i, handler){
        console.log( handler.toString() );
    });
});

// You can see the actual functions which will occur
// on certain events; great for debugging!

To go to listeners, then replace / change. Hope this helps!

+1
source

All Articles