ga-wdi-exercises / pixart_js

Use JS events and programmatically generated DOM elements to build a drawing application. [javascript, dom]
MIT License
9 stars 321 forks source link

Erica Andersen's Pixart Javascript/jQuery #72

Closed ericacomfort closed 9 years ago

ericacomfort commented 9 years ago

Comfort: 4/5 Completeness: 5/5 Concerns: My iteration to create 8000 divs makes my page timeout in the browser. I'd like to understand more about why this is happening/how to avoid this problem.

jshawl commented 9 years ago

Moving the event listener out of that loop should fix the page timeout. Try setting an event listener on the body and checking the event.target to handle the painting. :+1: