The hint didn't help. What am I missing?


#1

Instructions:
Inside the click event handler for '.arrow-prev', write an if statement to handle this case:

After creating the variables currentSlide and prevSlide, write an if statement that checks if prevSlide.length == 0. If it is, set prevSlide equal to the last slide using $('.slide').last();Try it out! In the web page to the right, click the previous arrow and see what happens!

My code:
$('arrow-prev').click(fucntion () {
$('.active-slide').addClass('currentSlide');
$('.active-slide').prev().addClass('prevSlide');
if (prevSlide.length == 0) {
prevSlide.length = $('.slide').last();
}

The hint did not help me, it just showed me what the event handler looked like. What am I missing?


#2

You've spelled function wrong.


#3

Thanks for the help. :slight_smile:
I clicked "Save & Submit Code", but it gave me this error message:
Oops, try again.
Remember to fade out the current slide and remove the 'active-slide' class.


#4

So that means you want to .fade() the .currentSlide, then remove the .activeSlide class.


#5

But without capitalization...

class="active-slide"

not:

class="activeSlide"

:wink:


#6

My bad, I should let you handle the jQuery. :slight_smile:


#7

@cadecodes No worries, you're doing fine, I just wanted to point that one thing out :slight_smile: