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 5

Eoghan Crowley
Eoghan Crowley
2,804 Points

My strokestyle wouldn't change after selecting a new color. Any obvious solution I'm just missing?

'context.strokeStyle = color;' seems to work when the page first loads but it doesnt change after I select a new color. I followed the whole tutorial up til now but can't finish it til this is fixed!!

Can you please take a Snapshot of your Workspace and share it here so we can look at your code?

It's probably just a minor typo in either the jQuery/JavaScript code for the click event on the color selector or in the HTML markup.

I have the same problem. https://w.trhou.se/7h839tia7b

I have the same problem, i am unable to change the color. I get the initial red when starting but not able to switch colors. any help?

Bosse Kemper: you added quotes around your this selector like this: $("this"), when it should be like this: $(this).

change your code from this

$(".controls").on("click", "li", function(){
    $(this).siblings().removeClass("selected");
    $(this).addClass("selected");
    color = $("this").css("background-color");
});

To this:

$(".controls").on("click", "li", function(){
    $(this).siblings().removeClass("selected");
    $(this).addClass("selected");
        color = $(this).css("background-color");
});