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 2

Roudy Antenor
Roudy Antenor
4,124 Points

My sliders do not update as fluidly and in realtime as the video

Hello , My sliders are working to update the span - However the instructor simply slides his sliders and the span updates while he is sliding in realtime - However my span only updates once i let go of the mouse click - wasn't the change() method supposed to update whenever there's a change? it is working like that for instructor but no for me --

EDIT TO QUESTION :

I did some research on api,Jquery and the mousemove() method instead of the change() method works as exhibited in the fluid updates of the teacher - It works - so should i be concerned later?

$('input[type=range]').mousemove(changeColor);

2 Answers

Steven Parker
Steven Parker
231,275 Points

It's normal for the change event to be emitted only when you release the mouse. But mousemove will fire for any mouse movement over the control, whether you are dragging with the button down or not.

I would recommend .on("input", ...) instead which will fire on every value change, but not on other mouse movements.

Roudy Antenor
Roudy Antenor
4,124 Points

Cool Steven, the .on('input',...) worked - Thank you!