Looking at this article , It seems that you would create the tag in your index.html file, and the you would be able to control it in the JavaScript file like so, assuming that the id of the canvas element is "myCanvas":(看一下本文 ,似乎您可以在index.html文件中创建标记,并且您可以像这样在JavaScript文件中对其进行控制,假设canvas元素的ID为“ myCanvas”:)
var canvasVariable = document.getElementById("myCanvas");
And then you would be able to add effects to that canvas by using methods like:(然后,您可以使用以下方法向该画布添加效果:)
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.moveTo(0,0);
ctx.lineTo(200,100);
ctx.stroke();
This example is from the aforementioned article and creates a diagonal line across the canvas.(该示例来自上述文章,并在画布上创建了一条对角线。)
Also, for future reference, mention that you are using jquery.(另外,为了将来参考,请提及您正在使用jquery。)
Thankfully I recognized the error and imported it.(值得庆幸的是,我认识到错误并将其导入。)
I hope this was able to help!(我希望这能够有所帮助!)
phylo(phylo)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…