Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1 from ranyefet/patch-1

added support for touch events
commit 76fb3845e4f70dd8509c4a7d5f45dfe3d4e10b28 2 parents 5da20e0 + 8378d7d
@martinaglv authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 knobKnob/knobKnob.jquery.js
View
8 knobKnob/knobKnob.jquery.js
@@ -40,7 +40,7 @@
options.turn(currentDeg/359);
}
- knob.on('mousedown', function(e){
+ knob.on('mousedown touchstart', function(e){
e.preventDefault();
@@ -53,7 +53,9 @@
var a, b, deg, tmp,
rad2deg = 180/Math.PI;
- knob.on('mousemove.rem',function(e){
+ knob.on('mousemove.rem touchmove.rem',function(e){
+
+ e = (e.originalEvent.touches) ? e.originalEvent.touches[0] : e;
a = center.y - e.pageY;
b = center.x - e.pageX;
@@ -100,7 +102,7 @@
options.turn(currentDeg/359);
});
- doc.on('mouseup.rem',function(){
+ doc.on('mouseup.rem touchend.rem',function(){
knob.off('.rem');
doc.off('.rem');
Please sign in to comment.
Something went wrong with that request. Please try again.