touch and mouse
This commit is contained in:
parent
ecc3e12e63
commit
79545b0dfb
12
js/main.js
12
js/main.js
@ -16,22 +16,16 @@ $(document).ready(function() {
|
|||||||
sizeAndPos();
|
sizeAndPos();
|
||||||
$(window).resize(sizeAndPos);
|
$(window).resize(sizeAndPos);
|
||||||
|
|
||||||
$c.on('mousedown touchstart', function(e) {
|
$c.bind('mousedown touchstart', function(e) {
|
||||||
|
|
||||||
var xy = relative(e.pageX, e.pageY);
|
var xy = relative(e.pageX, e.pageY);
|
||||||
startPoint(xy.x, xy.y);
|
startPoint(xy.x, xy.y);
|
||||||
window.active = true;
|
window.active = true;
|
||||||
|
}).bind('mousemove touchmove', function(e) {
|
||||||
}).on('mousemove touchmove', function(e) {
|
|
||||||
|
|
||||||
if (!window.active || settings.type == 'line') return;
|
if (!window.active || settings.type == 'line') return;
|
||||||
var xy = relative(e.pageX, e.pageY);
|
var xy = relative(e.pageX, e.pageY);
|
||||||
drawPoint(xy.x, xy.y);
|
drawPoint(xy.x, xy.y);
|
||||||
|
}).bind('mouseup touchend', function() {
|
||||||
}).on('mouseup touchend', function() {
|
|
||||||
|
|
||||||
window.active = false;
|
window.active = false;
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user