touch and mouse
This commit is contained in:
parent
41e87356fe
commit
87b085d765
10
js/main.js
10
js/main.js
@ -31,22 +31,16 @@ $(document).ready(function() {
|
||||
window.active = false;
|
||||
}).bind('touchstart', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
for( var i = 0, len = e.changedTouches.length; i < len; i++ ) {
|
||||
var touch = e.changedTouches[i];
|
||||
var touch = e.changedTouches[0];
|
||||
var xy = relative(touch.pageX, touch.pageY);
|
||||
startPoint(xy.x, xy.y);
|
||||
}
|
||||
window.active = true;
|
||||
}).bind('touchmove', function(e) {
|
||||
e.preventDefault();
|
||||
if(!window.active || settings.type =='line') return;
|
||||
|
||||
for( var i = 0, len = e.changedTouches.length; i < len; i++ ) {
|
||||
var touch = e.changedTouches[i];
|
||||
var touch = e.changedTouches[0];
|
||||
var xy = relative(touch.pageX, touch.pageY);
|
||||
drawPoint(xy.x, xy.y);
|
||||
}
|
||||
window.active = true;
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user