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

Salvador Cervantes
Salvador Cervantes
10,898 Points

Error at Line 31 but, I don't see anything wrong and now nothing done in app.js works at the end of this

//Problem: No user interaction casues no change to application
//Solution: When user interacts causes changes appropriatly
var color = $('.selected').css('background-color');


//When clicking on control list item
$('.controls li').click(function(){
  $(this).siblings().removeClass('selected');
  //deselect sibling elements
  //select element
  $(this).addClass('selected');
   color = $(this).css('background-color');


//When new color is pressed 
$('#revealColorSelect').click(function(){
   //Show color select or hide the color select
  changeColor();
  $('#colorSelect').toggle();
});

//update the New color
function changeColor() {
  var r = $('#red').val();  
  var g = $('#green').val();
  var b = $('#blue').val();
  $('#newColor').css("background-color", "rgb(" + r + "," + g + "," + b + ")");
}

//When color sliders change
$("input[type=range]").change(changeColor);

//When add color is pressed
  //Append the color to the controls ul
  //Select the new color 

//On mouse events on the canvas
  //Draw lines

1 Answer

Hey there,

On line 31, I think the problem is that you're referring to changeColor, a function, without the set of parentheses at the end. I believe the line

$("input[type=range]").change(changeColor);

needs to be this:

$("input[type=range]").change(changeColor());

Hope this helps!