HTML5“画布为空”
谁能帮助我吗?我正在滑动轮播中整理信息图表,但收到错误“画布为空”。我认为我可能有一些代码位于错误的位置,但我无法确定哪些代码位。我认为这导致应该出现在每个滑动
背景中的 SVG 不显示。谁能找出导致这些问题的原因吗?页面位于:http://weaver-wp.weavertest.com/radiation-infographic/< /a>
谢谢, 大卫
Can anyone help me? I'm putting together an infographic within a sliding carousel and I'm getting the error "canvas is null". I think I may have a few bits of code in the wrong place, but I'm having trouble working out which bits. I think it's causing the SVG that's supposed to appear in the background of each sliding <li>
to not be displayed.
Can anyone work out what's causing these problems? The page is here: http://weaver-wp.weavertest.com/radiation-infographic/
Thanks,
David
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您从 1 循环到 32,但页面上只有 31 个画布元素。在第 32 次迭代中,
document.getElementById('myCanvas_32')
返回null
,因此出现错误。You are looping from 1 to 32, but there are only 31 canvas elements on the page. In the 32nd iteration,
document.getElementById('myCanvas_32')
is returningnull
, hence the error.