Previous slide 2 (9/12)


#1

I have looked my code over and compared it to others, I am still getting these Error Messages:

Oops, try again. Remember to fade out the current slide and remove the 'active-slide' class.
SyntaxError: expected expression, got ')'

Here is my code:

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();
});

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

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

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

I can't figure out if it is a bug or I am missing something...


#2

Hi Heather,

You've got a few problems, but they're all easily fixed :)

  • Line 17 should contain only a closing curly brace (}) and a semi-colon (;), nothing else
  • Line 24 needs to have });
  • Line 25 is your main problem, you accidentally used a closing curly brace instead of an opening curly brace ({)
  • Line 31, you need to remove the closing parenthesis ())

I hope this helps!
Please let me know if you're still not being passed :)


#3

Face-palming myself for the closing curly brace. That worked perfectly, thanks for the extra eyes!!


#4

No problem, I'm always glad to help!


#5

Could you by chance post the new corrected code? I am having a horrible time with this one. Thank you!


#6

Hi @betarunner06338,

Posting code solutions in the forums isn't allowed. If you'd like help, please create a new forum topic with your code, a link to the exercise you're on, and the error message you're getting, and someone will help you over there :)


#7

I apologize, I did not know. I created a new forum. Any quick input would be awesome!


#8

@betarunner06338 Thank you for doing that, I'm a bit busy right now, but I'll help you as soon as I can if someone else doesn't first - It won't be long before I can help you, though :)


#9

Okay sounds good thank you