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

General Discussion

Code Challenge Responsive Slider Plugin - JavaScript Help

Task 3/4 Create a variable called "options" and set the key “animation” to “slide” and the key “navigationControl” to the boolean of “false”

This is my code

{ var options = {navigationControl: false, animation: "slide"}

It' saying Bummer! The variable 'options' is not set. Where am I going wrong

9 Answers

I've worked it out.

Hi Richard! Please share. I am really stuck on this one.

Never mind. Stefan's code helped: var options = {navigationControl: false, animation: "slide"}; $(".wmuSlider").wmuSlider(options); for some reason I tried it before and it didn't work. Tried it again after 10hours and it works, left me puzzled.

I am having the same issue and used the following code:

<script> var options = {navigationControl: false, animation: "slide"); $(".wmuSlider").wmuSlider(options); </script>

What am I doing wrong?

Got it :)

how did you work it out??? I have the same problem!! please help!

Hi Joe,

Basically, what I missed was the "}" instead of the ")". Please try:

var options = {navigationControl: false, animation: "slide"}; $(".wmuSlider").wmuSlider(options);

Good luck!

Thanks Stefan, I tried your code 10 hours ago and for some reason it didn't work. After trying everything and not finding success came back copied and pasted your code and it worked. The world of programming!!

You're welcome Larry!

Glad all worked out. Same here... sometimes a comma or something really small will void the code somehow. Nice when after a while you get through that.

Stefan, Where are you now in your career?

If you take the time to post "I've worked it out" you could probably spare the extra minute to explain just how you did it! -_-

Please/Thanks

I have:

var options = { animation:"slide", navigationControl:false; };

I had a lone semicolon after "false"..

this is the correct code

var options = { animation:"slide", navigationControl:false };

Just wanted to write this down so i can reiterate what i'm trying to understand, and hopefully it helps in anyway.

  1. first we need to create a variable called options

  2. we need to enter some adjustments to the plugin's keys (separated by commas between each adjustment), which can be called inside {}. I'm assuming that this is an object, since the last couple lessons that had objects in it used {curly braces}

  3. navigationControl is set to false (no quotes for boolean), while animation is set to "slide".

  4. end with ;

  5. then we expect to pass this into the plugin's parameter later on

var options = 
{
navigationControl: false,
animation: "slide"
};