1

我正在尝试在使用webgl-surface-plot的 3d 绘图的旋转中添加触摸设备的兼容性,但我无法进行最基本的测试。是该页面的链接。出于测试目的,我添加了以下代码,但我无法让这个简单的东西工作。

var is_touch_device = 'ontouchstart' in document.documentElement;
function tStart(e){document.getElementById("rangeSigmaX").innerHTML='touchstart';}

随后是 SurfacePlot.initGL 函数 (SurfacePlot.js) 中的以下内容。

if(is_touch_device){
        var el = $('canvas.surfacePlotCanvas');
        el.addEventListener('touchstart', tStart, false);
        el.addEventListener("touchend", tStart, false);
        el.addEventListener("touchcancel", tStart, false);
        el.addEventListener("touchleave", tStart, false);
        el.addEventListener("touchmove", tStart, false); 
        }

这些听众似乎都没有工作。任何帮助,将不胜感激。

4

0 回答 0