8/12 It pass but doesnt work


#1

Where is bug or mistake?

   var main=function(){
$('.dropdown-toggle').click(function(){
    $('.dropdown-menu').toggle();
    });
    $('.arrow-next').click(function(){
      var currentSlide=$('.active-slide');
        var nextSlide=currentSlide.next();
       if(nextSlide.length==0){
        nextSlide=$('.slide').first();
        };
    currentSlide.fadeOut(600).removeClass('active-slide');
    nextSlide.fadeIn(600).addClass('active-slide');
    var currentDot=$('.active-dot');
    var nextDot=currentDot.next();
    if(nextDot.length==0){
    nextDot=$('.dot').first();
    };
    currentDot.removeClass('active-dot');
    nextDot.addClass('active-dot');
        });
        $('.arrow-prev').click(function(){
    var currentSlide=$('.active-slide');
    var prevSlide=currentSlide().prev();
    currentSlide.fadeOut(600).removeClass('active-slide');
    prevSlide.fadeIn(600).addClass('active-slide'); 
        });
    };   
$(document).ready(main);

#2

The following code-line, from your arrow-prev =click= Eventhandler

should be changed into

var prevSlide=currentSlide.prev();

#3

Nope


#4

Your print-screen is PERFECT !!!
The Oops-message is exactly-masking the code-line
one would like to see !!! ( fade-in previous-slide and add the "active-slide" class )

I tried a the your code (with the suggested modification) in a windows 8.1 IE11 environment and got a pass.

Either you made a wrong modification,
OR
maybe...
under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser

and

Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

Addendum
General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).


#5

Tnx for help.I am using Linux Debian 8,maybe problem was because of him.After some time it passed for me.
P.S:Hints for F5 and copy/paste I already use all the time on codecademy.I didnt know that I need to F5 after making corrections.


#6

Try this....

var main = function() {
$('.dropdown-toggle').click(function() {
$('.dropdown-menu').toggle();
});

$('.arrow-next').click(function() {
var currentSlide = $('.active-slide');
var nextSlide = currentSlide.next();

var currentDot = $('.active-dot');
var nextDot = currentDot.next();

if(nextSlide.length == 0) {
nextSlide = $('.slide').first();
nextDot = $('.dot').first();
}

currentDot.removeClass('active-dot');
nextDot.addClass('active-dot');

currentSlide.fadeOut(600).removeClass('active-slide');
nextSlide.fadeIn(600).addClass('active-slide');

});

$('.arrow-prev').click(function() {
var currentSlide = $('.active-slide');
var prevSlide = currentSlide.prev();
currentSlide.fadeOut(600).removeClass('active-slide');
prevSlide.fadeIn(600).addClass('active-slide');
});

}
$(document).ready(main);