get tap event and its position

  • The page where I embed krpano needs to know about tap events on mobile, but krpano seems to eat them? Adding a listener to "document.onmousedown" works fine, but "document.onclick" or "document.ontap" does not. Using "<events onclick="js(myTest())"/>" in the sphere.xml gets me the fact that there's an event, but I need the event's properties like x/y coordinates. I aso tried krpano.get("mouse.x") but the values I get are larger than the resolution of my smartphone display so they cannot be right.

  • Thanks, this works for me now:

    Code
    var scale = krpano.get("stagescale");
                    if (scale) {
                        x = krpano.get("mouse.x") * scale;
                        y = krpano.get("mouse.y") * scale;
                    }

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!