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

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

Naivedya Bansal
Naivedya Bansal
5,483 Points

color change on moving slider

in the current implementation, the color changes when i let go of the slider button,is there a way to program so that the color changes while we are sliding the button?

1 Answer

Greg Kaleka
Greg Kaleka
39,021 Points

This is actually really easy to do. All you have to do is change $(".sliders").change(function... to $(".sliders").mousemove(function.... That way, the app recalculates the color whenever your mouse is moving in the slider section (including while you're dragging them).

You could probably refine it a bit so it only changes them when the mouse is moving and clicked (similar to what we do for the actual drawing), but this works as a quick fix.