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

JavaScript jQuery Basics (2014) Creating a Simple Drawing Application Perform: Part 3

Question about how the "Add Color" button works.

So in this video we are creating a simple drawing application.

My code is working and I am not having any issues with it, however I wonder WHY when you click "New Color" it shows the sliders because we have added the code to show them when the "New Color" button is clicked, but when you click "Add Color" the sliders automatically hide themselves. I assume there would have to be code that is making this happen but I can't seem to figure it out. Any clues?

Snapshot of my workspace: https://w.trhou.se/eo1854s4s3

1 Answer

I first checked your code and couldn't find an explanation for the described behaviour. So i forked your workspace and tested it myself. It shouldn't hide the sliders if you click the "Add Color" button and it doesn't on the workspace i forked. It only toggles the div with the sliders if you press the "New Color" button.

You're completely right, I have no clue why I thought this was happening. I mean, I REALLY thought this was the case and was confused, so much so that I wrote a question about it. Weird, I guess thats what happens when you are coding @ 5am. Lol.

Thanks, and sorry for the confusion.