Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Seth McCombs
16,767 PointsJQuery Drawing App: Erasing or Refreshing?
I just wrapped up the JQuery "Drawing Application" lesson, is it possible to create a button to refresh just the canvas element, allowing a new image to be drawn?
Theoretically, using a white color would allow you to "erase" the lines, maybe with a script to increase the cursor size? Is that possible?
1 Answer
Hugo Paz
15,622 PointsI answer that here https://teamtreehouse.com/forum/adding-an-erase-button-to-simple-drawing-app-howto
If you want to clear the canvas you can use context.clearRect ( x , y , w , h );
Seth McCombs
16,767 PointsSeth McCombs
16,767 PointsThanks!! I read your answer on the other pose, after a re-read it makes more sense!