mouseup

ng-touchstart and ng-touchend in Angularjs

限于喜欢 提交于 2019-11-30 17:24:55
I have an element which fires functions on ng-mousedown and ng-mouseup . However, It doesn't work on touch screen, is there any directive like ng-touchstart and ng-touchend ? There is a module for this: https://docs.angularjs.org/api/ngTouch But you can write your own directives for events too: <!doctype html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.js"></script> </head> <body ng-app="plunker"> <div ng-controller="MainCtrl"> <div my-touchstart="touchStart()" my-touchend="touchEnd()"> <span data-ng-hide="touched">Touch Me ;)</span> <span data-ng

Does jQuery mouseup event work on touch devices?

做~自己de王妃 提交于 2019-11-30 14:41:45
问题 I couldn't find any answer so I'm asking here. Currently I don't own any touch devices so I can't test it. The following code hides all subcontainers in a container if clicked outside of it. $(document).mouseup(function(e) { var container = $('#container'); if (!container.is(e.target) // if the target of the click isn't the container... && container.has(e.target).length === 0) // ... nor a descendant of the container { $('.subcontainer').hide(); } }); Does this work on touch devices or there

Does jQuery mouseup event work on touch devices?

只愿长相守 提交于 2019-11-29 03:28:52
I couldn't find any answer so I'm asking here. Currently I don't own any touch devices so I can't test it. The following code hides all subcontainers in a container if clicked outside of it. $(document).mouseup(function(e) { var container = $('#container'); if (!container.is(e.target) // if the target of the click isn't the container... && container.has(e.target).length === 0) // ... nor a descendant of the container { $('.subcontainer').hide(); } }); Does this work on touch devices or there is any equivalent of mouseup for touch devices? No, it does not work. But here is a touchstart and