Skip to content

freebrowser1/jquery-touchable

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Convert touch events into mouse events

About

This provides convertion touch events into mouse events The target is a event of mousedown, mousemove and mouseup.

Usage

$(document).mousedown(function (evt) {
  print(
    evt.type, //< mousedown
    evt.originalEvent.type // touchstart if touch terminal
  );
}).mousemove(function (evt) {
  print(
    evt.type, //< mousemove
    evt.originalEvent.type // touchmove if touch terminal
  );
}).mouseup(function (evt) {
  print(
    evt.type, //< mouseup
    evt.originalEvent.type // touchend if touch terminal
    evt.pageX //< emulate pageX
  );
});

About

Convert touch events into mouse events

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%