第一种: <script> (function($) { var options, Events, Touch; options = { x: 20, y: 20 }; Events = ['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown', 'tap', 'longTap', 'drag']; Events.forEach(function(eventName) { $.fn[eventName] = function() {…