This forum is now read-only. Please use our new forums! Go to forums

banner
Close banner
0 points
Submitted by Kowar Sindi
over 9 years

Oops, try again. Remember to remove '.active-dot' from the current dot.

What is wrong with my code? And if you have passed this exercise please share your whole code with me. Thank you.

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(); }); $(‘.arrow-prev’).click(function() { var currentSlide = $(‘.active-slide’); var prevSlide = currentSlide.prev(); if(prevSlide.length == 0) { prevSlide = $(‘.slide’).last(); prevDot = $(‘.dot’).last();

} currentSlide.fadeOut(600).removeClass(‘active-slide’); prevSlide.fadeIn(600).addClass(‘active-slide’); }); } $(document).ready(main);

Answer 546f77957c82cae7cb003132

-5 votes

Permalink

Kowar, you should be removing the ‘active-dot’ class from currentDot and adding it to nextDot.

To do this, just use: currentDot.removeClass(‘active-dot’); nextDot.addClass(‘active-dot’);

The first line removes the class ‘active-dot’ from currentDot. The second adds the class to nextDot.

points
Submitted by Trika D'Costa
over 9 years

2 comments

Kowar Sindi over 9 years

Still not working! can you please post your code?

Leonard Riley over 9 years

Hello, I’m having the same issue as well. Did you have it figured out yet?