5. Next Slide 2 - If Statement wrong?


Exercise i'm stuck at:

Hi guys, hope one of you can help me with this problem:
You've got 4 slides on the side, when i am at the 3rd one and click on the arrow to get the last one, it first behaves right (fades in next slide), then wrong: Fades in the first slide as a second layer above the last side without me doing anything!
The expected behaviour would be me clicking on the arrow again so that the first slide of those 4 appears again.

This is the error message i get:
Oops, try again.
When on the last slide, it looks like the next arrow isn't wrapping
back to the first slide. Look back at the instructions and check the
code inside the if statement.

Here's my code:

var main = function() {
        var currentSlide = $('.active-slide');
        var nextSlide = currentSlide.next();
        if(nextSlide.length == 0){
            nextSlide = $('.slide').first();



Hi Jonas,

Check your capitalization of active-slide on line 15 very carefully - it needs to be all lowercase :slight_smile:


Aaaah!!! Thanks for help anyways - that was the mistake.


This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.