From c3bd4bee244039e1bd4e413135acedbc318504b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Steunou?= Date: Thu, 17 Jul 2014 09:36:27 +0200 Subject: [PATCH 1/2] Use pageXOffset as fallback IE9 & IE10 do not have the alias scrollX/Y pageXOffset seems the original and standard property. See https://developer.mozilla.org/en-US/docs/Web/API/Window.scrollX Maybe it could be used alone, not as a fallback for scrollX/Y --- js/sketch.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/sketch.js b/js/sketch.js index abaad9b..a34780f 100755 --- a/js/sketch.js +++ b/js/sketch.js @@ -269,8 +269,8 @@ var Sketch = (function() { bounds = target.getBoundingClientRect(); - touch.x = touch.pageX - bounds.left - win.scrollX; - touch.y = touch.pageY - bounds.top - win.scrollY; + touch.x = touch.pageX - bounds.left - (win.scrollX || win.pageXOffset); + touch.y = touch.pageY - bounds.top - (win.scrollY || win.pageYOffset); return touch; } @@ -580,4 +580,4 @@ var Sketch = (function() { return Sketch; -})(); \ No newline at end of file +})(); From 5a47d6178716be62d868103e89ba1ad5121fa2cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Steunou?= Date: Thu, 17 Jul 2014 09:49:09 +0200 Subject: [PATCH 2/2] Add mouseout & mouseover events Should fix issue #58 --- js/sketch.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/sketch.js b/js/sketch.js index abaad9b..3639a44 100755 --- a/js/sketch.js +++ b/js/sketch.js @@ -157,6 +157,8 @@ var Sketch = (function() { pointer, 'mousemove', 'touchmove', pointer, 'mouseup', 'touchend', pointer, 'click', + pointer, 'mouseout', + pointer, 'mouseover', doc, @@ -580,4 +582,4 @@ var Sketch = (function() { return Sketch; -})(); \ No newline at end of file +})();