jQueryTouchActionEx

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

Ezt a szkriptet nem ajánlott közvetlenül telepíteni. Ez egy könyvtár más szkriptek számára, amik tartalmazzák a // @require https://update.greasyfork.org/scripts/419065/894972/jQueryTouchActionEx.js hivatkozást.

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

Fejlesztő
家守カホウ
Verzió
0.3.1
Létrehozva
2020.12.23.
Frissítve
2021.01.28.
Size
6 KB
Licensz
Ismeretlen

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

  • タップ
  • ダブルタップ
  • ホールド(おまけ程度)
  • スワイプ
  • 上下左右のスワイプ

// 前提:jQueryを使用します

// 単純なタップ(interval:タップとホールドの境目の時間ms)
$('div').tap(interval)
.on('tap', e => console.log(e))
.on('hold', e => console.log(e))

// ダブルタップを考慮したタップとダブルタップ
$('div').doubletap(interval)
.on('tap', e => console.log(e))
.on('hold', e => console.log(e))
.on('doubletap', e => console.log(e))

// スワイプ(min_dist:最低認識距離pixel)
$('div').swipe(min_dist)
.on('swipe', (e, angle, distance) => {
    console.log(angle + ' ' + distance)
})

// 上下左右のスワイプ(range:水平垂直を中心に何度までを認識するか)
$('div').swipe_way(min_dist, range)
.on('swipeup swipedown swipeleft swiperight', (e, angle, distance) => console.log(e.type))

swipe_wayのrangeは画像参照