jQuery touch action Ex

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

2021-01-08 يوللانغان نەشرى. ئەڭ يېڭى نەشرىنى كۆرۈش.

بۇ قوليازمىنى بىۋاسىتە قاچىلاشقا بولمايدۇ. بۇ باشقا قوليازمىلارنىڭ ئىشلىتىشى ئۈچۈن تەمىنلەنگەن ئامبار بولۇپ، ئىشلىتىش ئۈچۈن مېتا كۆرسەتمىسىگە قىستۇرىدىغان كود: // @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!)

ئاپتورى
家守カホウ
نەشرى
0.2
قۇرۇلغان ۋاقتى
2020-12-23
يېڭىلانغان ۋاقتى
2021-01-08
Size
793 بايت
ئىجازەتنامىسى
يوق

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

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

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