My 360 panorama image works perfectly on desktop, but I'm having trouble getting the mouse events to work on mobile phones. How can I resolve this issue?
// listeners
document.addEventListener("mousedown", onDocumentMouseDown, false);
document.addEventListener("mousemove", onDocumentMouseMove, false);
document.addEventListener("mouseup", onDocumentMouseUp, false);
I tried changing the events to
document.addEventListener("touchstart", onDocumentMouseDown, false);
document.addEventListener("touchmove", onDocumentMouseMove, false);
document.addEventListener("touchend", onDocumentMouseUp, false);
Unfortunately, this solution is not effective for mobile devices.