var ctx = canvas.get(0).getContext("2d");我就想知道这get(0)啥意思啊

var ctx = canvas.get(0).getContext("2d");

canvas.attr("width",$(window).get(0).innerWidth);

canvas.attr("height",$(window).get(0).innerHeight);

$(window).resize(resizeCanvas);

function resizeCanvas(){

     canvas.attr("width",$(window).get(0).innerWidth);

     canvas.attr("height",$(window).get(0).innerHeight);     

};


sdwsq
浏览 2332回答 2
2回答

沉醉美少年

有多个canvas,取第一个
打开App,查看更多内容
随时随地看视频慕课网APP