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

Tyler Rosenberg Pixart Solution #238

Closed TyRyanR closed 8 years ago

TyRyanR commented 8 years ago

Completeness: 4.5 Comfort: 4

I don't understand why I couldn't use the THIS keyword twice and I had to comment out line 15 through 19.

nayana487 commented 8 years ago

Your code isn't broken, it's doing what is expected. The mouseover happens before the click so the color change gets implemented there. If you test out with something like:

$(".square").on("click", changeToGreen)

function changeToGreen() { $(this).css("border-style", "dotted"); }

You'll notice that when you click, the dotted border gets added.

Otherwise, nice job here!