This is going to be another short post where I share some code, and much more importantly provide a demo to play with. There have been a number of times when our team has an idea that would require some creative drawing & lines in a browser. This is traditionally Flash territory. There has been lots of work with canvases to allow drawing in Javascript, but these are still exploratory and are not really ready for the lime-light.
It is actually quite possible to draw lines on the screen. An excellent explanation of an efficient method can be found at http://www.p01.org/releases/Drawing_lines_in_JavaScript/ (I believe it was written by Mathieu ‘P01′ HENRI) I recently turned this method into a Prototype class with some useful functionality.
My demo is at http://lines.live2code.ca (Tested on IE7, IE8, FF3 & Safari)
or you can check out the code at http://github.com/forrest/javascript-line-class
Tags: JavaScript, Technology
I forgot to mention it, but I love talking to developers and meeting new people. I would love to hear from you at http://twitter.com/fzeisler
Nice touch. Can you make the lines to stay on the canvas?