1. $(this).on({
    2. touchstart: function (e) {
    3. // 长按事件触发
    4. timeOutEvent = setTimeout(function () {
    5. timeOutEvent = 0;
    6. '长按3s之后执行如下代码'
    7. }, 3000);
    8. },
    9. touchmove: function () {
    10. clearTimeout(timeOutEvent);
    11. timeOutEvent = 0;
    12. },
    13. touchend: function () {
    14. clearTimeout(timeOutEvent);
    15. if (timeOutEvent != 0) {
    16. '单机执行以下代码'
    17. }
    18. return false;
    19. }
    20. })