Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Canvas and jQuery?

Is it possible to use jQuery with the HTML5 <canvas> element? Or do I have to do it with plain JavaScript?

I'm just wondering, because I think I could save a lot of time with using jQuery, but I have no clue about the <canvas> element's uses yet, so it may be completely impossible!

Anyone know if I can use jQuery for this?

like image 475
Qcom Avatar asked Aug 24 '10 17:08

Qcom


People also ask

Can I use jQuery in canvas?

the answer would be yes. you need to use the plain JavaScript.. it gives you access to the canvas using the jQuery formatting that we are used for .

What is jQuery canvas?

The HTML <canvas> element is used to draw graphics on a web page. The graphic to the left is created with <canvas> . It shows four elements: a red rectangle, a gradient rectangle, a multicolor rectangle, and a multicolor text.

Does canvas support JavaScript?

<canvas> is an HTML element which can be used to draw graphics via scripting (usually JavaScript).

Is jQuery discontinued?

The team announced that the cross-platform jQuery Mobile project under its umbrella will be fully deprecated as of October 7, 2021. New technologies for mobile app development have evolved since this project was launched in 2010, so we're encouraging developers to plan for this jQuery Mobile transition.


1 Answers

You can use jQuery to select the canvas element, but you'd have to use its own methods. A decent start would be https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial.

like image 198
meder omuraliev Avatar answered Sep 24 '22 17:09

meder omuraliev