add touch events
This commit is contained in:
parent
4acb6e701c
commit
74573d8f7c
@ -138,8 +138,8 @@
|
|||||||
// bonzi cursor
|
// bonzi cursor
|
||||||
['mousemove', 'touchstart', 'touchmove'].forEach(type => {
|
['mousemove', 'touchstart', 'touchmove'].forEach(type => {
|
||||||
window.addEventListener(type, event => {
|
window.addEventListener(type, event => {
|
||||||
document.getElementById('cursor').style.top = event.clientY + 'px';
|
document.getElementById('cursor').style.top = (event.clientY || event.touches[0].clientY) + 'px';
|
||||||
document.getElementById('cursor').style.left = event.clientX + 'px';
|
document.getElementById('cursor').style.left = (event.clientY || event.touches[0].clientY) + 'px';
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user