jQuery touch action Ex

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

Від 08.01.2021. Дивіться остання версія.

Цей скрипт не слід встановлювати безпосередньо. Це - бібліотека для інших скриптів для включення в мета директиву // @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.

(У мене вже є менеджер скриптів, дайте мені встановити його!)

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);