小编Ant*_*nta的帖子

HTML Canvas 未在 Safari 上显示

我正在使用下面 Codepen 中的代码来创建一个全角画布,用于模拟滚动图像序列上的视频播放。

\n

它在 Chrome 中工作正常,但我无法使其在 Safari \xe2\x80\x93 上工作,它只是显示为白色,就好像它是空的一样。如果我检查该元素,它似乎不存在于 Safari 中。

\n

是否存在已知问题或可以在代码中修复的问题?

\n

代码笔: https: //codepen.io/SalmanShaikh/pen/MWeNBLL

\n
const appleSequenceImages = [];\n//number of images 131; fill the array\n//see the squence obj below for image path.\nfor (let i = 0; i <= 374; i++) {\n  console.log(`${`${i}`.slice(-4)}.jpg`);\n  appleSequenceImages.push(`${`${i}`.slice(-4)}.jpg`);\n}\n\n\nconst requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;\n\nclass EventEmitter {\n  listeners = {}\n  addListener(eventName, fn) {\n    this.listeners[eventName] = this.listeners[eventName] || [];\n    this.listeners[eventName].push(fn);\n    return this;\n  }\n  on(eventName, fn) {\n    return this.addListener(eventName, fn);\n  }\n …
Run Code Online (Sandbox Code Playgroud)

html scroll canvas

6
推荐指数
1
解决办法
382
查看次数

标签 统计

canvas ×1

html ×1

scroll ×1