Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.
/ fastclick Public archive

"Fast" click JavaScript event for touch devices

Notifications You must be signed in to change notification settings

kozmoz/fastclick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

"Fast" JavaScript Click Event

When working on a web app for touch devices (iPhone / iPad), you will soon notice that click events are rather slow to fire. There is a delay due to the fact that the device waits for the user to complete a gesture before deciding that the intended gesture was in fact a click.

I wrote a simple script that detects whether the device is touched without moving. When tapped without move, it fires a custom event named "fast click". This alternative event fires much faster then an ordinary click event.

A normal click event takes approximately 450 milliseconds to fire, in contrast the "fastclick" event takes approximately only 60 milliseconds to fire.

Demo

Blog

Compatibility

Tested in Safari desktop and mobile browser only.

About

"Fast" click JavaScript event for touch devices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published