Skip to content

Triggers custom browser events that normalize touch and mouse interaction

Notifications You must be signed in to change notification settings

jasonford/client-events

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

client-events

Triggers custom browser events that normalize touch and mouse interaction

Usage

attach to element events however you usually do:

// addEventListener
DOMelement.addEventListener("drag", function (event) {...});

// jQuery
$selection.on("drag", function (event) {...});

Events

###event names in order of triggering:

  • "touch"
  • 0+ "pinch" events if user is using 2 fingers. only drag events will fire until both fingers are removed
  • 0+ "drag" events
  • "tap" event if user touched and removed finger or clicked mouse quickly without dragging
  • "hold" event if user did not drag and held finger or mouse down longer than a tap
  • "drop" event on mouseup or when user removes finger
  • "swiperight" or "swipeleft" if user quickly moved finger or mouse while dragging

About

Triggers custom browser events that normalize touch and mouse interaction

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published