猿问

Pixi.JS无法在移动设备上运行,原因是AccessibilityManager抛出错误

当我在chrome中点击“ toogle设备工具栏”,浏览器进入移动模式pixi.js无法正常工作。在三星A3上,我也有同样的问题。

bundle.js:19086 Uncaught TypeError: Cannot read property 'appendChild' of null at AccessibilityManager.createTouchHook


德玛西亚99
浏览 268回答 1
1回答

跃然一笑

我修好了它。我的错...我试图在文档完全加载之前创建PIXI.Application。在桌面版本中,它没有问题,但是在移动版本中,它的工作不正确,因为使用createTouchHook尝试将子元素追加到文档正文中。不正确的代码:let app = new PIXI.Application(config.screen.width, config.screen.height, { transparent: true }); $(document).ready(function(){     //some actions with pixi.js });正确的代码是:$(document).ready(function() {    let app = new PIXI.Application(config.screen.width, config.screen.height, { transparent: true });});
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答