jQueryTouchActionEx

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

Skrip ini tidak untuk dipasang secara langsung. Ini adalah pustaka skrip lain untuk disertakan dengan direktif meta // @require https://update.greasyfork.org/scripts/419065/894972/jQueryTouchActionEx.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!)

Penulis
家守カホウ
Versi
0.3.1
Dibuat
23 Desember 2020
Diperbarui
28 Januari 2021
Size
6,3 KB
Lisensi
N/A

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

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

// 前提: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は画像参照