Firefox的触控演示,超酷!
程序员文章站
2022-04-27 13:57:50
...
Felipe Gomes为Firefox添加了触控功能,可以在内容空间中使用(Web devs中也可以使用)。
很酷的演示:http://vimeo.com/6214945
点击查看所有示例代码:https://wiki.mozilla.org/Firefox/Projects/Multitouch_Polish/DOM_Events/Examples
很酷的演示:http://vimeo.com/6214945
var assignedFingers = {}; var lastused = 0; function touchMove(event) { var divId; if (lastused <= 4) return; if (assignedFingers[event.streamId]) { divId = assignedFingers[event.streamId]; } else { divId = "trackingdiv" + (++lastused); assignedFingers[event.streamId] = divId; } document.getElementById(divId).style.left = event.clientX + 'px'; document.getElementById(divId).style.top = event.clientY + 'px'; } document.addEventListener("MozTouchMove", touchMove, false); document.addEventListener("MozTouchRelease", function() { lastused--; }, false);
点击查看所有示例代码:https://wiki.mozilla.org/Firefox/Projects/Multitouch_Polish/DOM_Events/Examples