0

我正在尝试在 node.js 堆栈之上创建一个使用 Paper.js 构建的简单调谐器。

调谐器在桌面浏览器中运行良好,但在 iPhone 或 iPad 中,单击六个矩形(或字符串)之一会导致屏幕奇怪闪烁:http: //morning-temple-9106.herokuapp.com/

我尝试了这些与 iphone 上的一般 html 闪烁相关的 css 修复,但没有运气。

canvas {
    -webkit-backface-visibility: hidden;
    -webkit-transform: translate3d(0,0,0);
}

这是加载音频的 JS——我在调用 playNote 之前加载文件以加快播放速度。即使我在 playNote 中加载也会发生闪烁。

var audioPlayerE = new Audio();
audioPlayerE.src="strings/E.mp3"
audioPlayerE.load();
var audioPlayerA = new Audio();
audioPlayerA.src="strings/A.mp3"
audioPlayerA.load();
var audioPlayerD = new Audio();
audioPlayerD.src="strings/D.mp3";
audioPlayerD.load();
var audioPlayerG = new Audio();
audioPlayerG.src="strings/G.mp3";
audioPlayerG.load();
var audioPlayerB = new Audio();
audioPlayerB.src="strings/B.mp3";
audioPlayerB.load();
var audioPlayerElittle = new Audio();
audioPlayerElittle.src="strings/Elittle.mp3";
audioPlayerElittle.load();

playNote = function(index,count) {
    var noteStr;
    if(index-count==0) {audioPlayerE.play()}
    if(index-count==1) {audioPlayerA.play()}
    if(index-count==2) {audioPlayerD.play()}
    if(index-count==3) {audioPlayerG.play()}
    if(index-count==4) {audioPlayerB.play()}
    if(index-count==5) {audioPlayerElittle.play()}
}

这是我的 github 仓库: https ://github.com/dannycochran/cs184

4

1 回答 1

0

从:

iPad Safari:点击链接时如何禁用快速闪烁效果

没有意识到这只是一个闪烁的效果,将其添加到 css 中修复了它:

-webkit-tap-highlight-color: rgba(0,0,0,0);
于 2013-03-22T15:45:39.153 回答