Lesson 9 Previous Slide 2 where is the error


#1
 var main = function() {
 $('.dropdown-toggle').click(function       () {
  $('.dropdown-menu').toggle()
   });
  $('.arrow-prev').click(function() {
    var currentSlide = $('.active           -slide');
    var prevSlide = currentSlide.prev         ();
    var currentDot = $('.active-dot'       );
var prevDot = currentDot.prev();

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

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


currentDot.removeClass('active-dot');
prevDot.addClass('active-dot');
 });
$(document)ready.(main);

#2

@csscoder68873 What lesson is this? Because in slide two your not suppose to be manipulating the dots yet? :confused:


#3

Hey @csscoder68873

I think your error is in the arrow-prev section.
Where you remove and add the class, you put ('.active-slide'), but because it adds a class, it knows it's a class so you can just write it like this ('active-slide').
I hope that does the trick. :smile:

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


#4

Thanks but it is not working.
Rajesh


#5

It is the lesson 9 of the Interactive Website but wrongly I had put active- dot line which i have removed but the editor remarks are Oops fade out current slide and remove active slide.
I have completed 98% of the course and stuck up on lesson 9 and 11.Pl help out with full code for these two lessons.I will be grateful to you.


#6

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)


#7

@veryaliona Dont give people your code. Its against the guildlines, and it only makes the other person not smarter. Since if he knew his mistakes he would be better of in programming.....................


#8

@amanuel2 I'm sorry for posting it here. Thanks for hiding it though. I didn't know it was against the rules.


#9

I would request you to get the lesson 9 passed as this is the only lesson left uncleared in this course as 99% the course has been completed.
Rajesh


#10

@csscoder68873 You're missing your entire $('.arrow-next').click(function() {...}); code segment. You should probably go through the exercises before this one, then come back to this one again.


Please stop asking people for answers, it's against the forum guidelines.


#11