almost 9 years ago
JCanvas: As we know that canvas is used to draw graphics with the help of javascript. In this there are certain properties to draw a line, circle, box, etc but canvas does not support event handlers.
JCanvas is a javascript library which is written in JQuery, it wraps around the HTML and and add new featues, capabilities like animation, drag-drop, events handlers, etc to it. Also we can extend JCanvas with our own methods and properties using extend() function.
Example:
HTML:
SCRIPT:
Also, we have to include the the attached jcanvas.min.js and jquery.min.js file to make it work.
There are many supported events in Jcanvas:
drawRect()
drawArc()
drawBezier()
drawVector()
drawGraph()
drawPolygon()
drawImage()
drawText()
drawEllipse()
drawLine()
drawQuadratic()
animateLayer()
drawSlice()
Also many event handlers:
click
dblclick
dragstart
drag
dragstop
touchstart
touchend
touchmove
mousedown
mouseup
mousemove
mouseover
mouseout
This is will make your Canvas/Graphics much more interactive and compatible with the events.
Can you help out the community by solving one of the following Javascript problems?
Do activity (Answer, Blog) > Earn Rep Points > Improve Rank > Get more opportunities to work and get paid!
For more topics, questions and answers, please visit the Tech Q&A page.
0 Comment(s)