11.11 Previous Dot 2


#1

Hi, I keep getting an error asking me to remove active dot from currentDot.


#2

try looking to see if you missed any $.


#3

hmm had some problems with this lesson myself but i just manage to get it right now, after a few days.

From what i see, the message points out > ' . active-dot ' ... there is a point there. Try adding the point to both currrentDot and prevSlide ( '.active-dot') . This adding worked for me although the "oops, try again..." message for me was about defining the variables.

I think this lesson is a bit buggy. Hope it worked for you also.


#4

same problem here....


#5

Hi Nijhawan,

Could you please copy/paste your entire code into the forum so we can help you? It's hard to work off of an incomplete screenshot.


#6

here is how l fixed mine if it will help you

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

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