redcell1984 Posted March 21, 2013 Share Posted March 21, 2013 Hello, I am wanting to create a function on my website that allows visitors to use their cursor to draw. The visitor is not required to make any selections to do this. I would have an area where as soon as the cursor moves a thin line or trail will be left wherever the cursor goes - effectively allowing them to draw. This trail would remain until they leave or refresh the site. I have seen this done on a website a few years ago but unfortunately I don't have examples to illustrate. Can anyone offer advice as to how this may be done? Would this require JavaScript or something else? Any advice would be greatly appreciated. Thanks Paul Link to comment Share on other sites More sharing options...
justsomeguy Posted March 22, 2013 Share Posted March 22, 2013 It would require Javascript, and probably a canvas. I haven't used canvas much, but something that jumps to mind is using the mousemove event to constantly make the pixel at the mouse coordinates black. Link to comment Share on other sites More sharing options...
redcell1984 Posted March 22, 2013 Author Share Posted March 22, 2013 I've had a quick search and it seems a canvas is the way to go to achieve the desired result. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now