jQuery touch action Ex

簡単なタッチ操作のイベントを追加します

As of 2021-01-08. See the latest version.

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/419065/888669/jQuery%20touch%20action%20Ex.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         jQuery touch action Ex
// @version      0.2
// @description  簡単なタッチ操作のイベントを追加します
// @author       y_kahou
// ==/UserScript==

if (window.jQuery) (function($) {
    'use strict';
    
    $.fn.tap = function(interval = 200) {
        addTap(this[0], {interval: interval})
        return $(this)
    }
    $.fn.doubletap = function(interval = 200) {
        addDoubletap(this[0], {interval: interval})
        return $(this)
    }
    $.fn.swipe = function(min_dist = 50) {
        addSwipe(this[0], {min_dist: min_dist})
        return $(this)
    }
    $.fn.swipe_way = function(range = 90, min_dist = 50) {
        addSwipeWay(this[0], {range: range, min_dist: min_dist})
        return $(this)
    }
})(window.jQuery);