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