24
26

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Android 4.0系のWebViewでtouchendが発火しないバグ対策

Last updated at Posted at 2013-10-12
// Android 4.0系でtouchendが発火しない対策
// # touchstart時もしくはtouchmove時にe.preventDefault()で
// # ブラウザのスクロールを停止しないとtouchendが発火しない
$("*")
	.on("touchstart", function(e) {
		Y1 = e.originalEvent.touches[0].clientY;
	})
	.on("touchmove", function(e) {
		Y2 = e.originalEvent.touches[0].clientY;
		if(Math.abs(Y1 - Y2) < 5){
			e.preventDefault();
		}
	});
24
26
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
24
26

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?