"remember to fade out current slide" error - what's wrong here?


#1

PLEASE HELP!!! error 'remember to fade out current slide and remove 'active-slide'

$('.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();

  });

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

  if(prevSlide.length == 0) {
  prevSlide = $('.slide').last();    
  }

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

});

}
$(document).ready(main);


#9 - Why does it keep telling me to fade out the current slide?
#2

Hi David,

  1. Is that your entire code?
  2. Could you please post a link to the exercise you're on?

Right here:

You're only closing your $('.arrow-next').click(...); part, and not the if statement as well right there. So just before the }); shown, add a closing curly brace (}) on the line above it, to close the if statement :slightly_smiling:


#3

you rock thanks for the support, always those curlies!:slightly_smiling:


#4

A post was split to a new topic: Why am I being told "Remember to fade out the current slide"?


#7