I need help in prev slide 2 it says : Oops, try again. Make sure you have defined all the variables!


#1

var main = function () {
$('.dropdown-toggle').click(function () {
$('.dropdown-menu').toggle();});
$('.arrow-next').click(function () {
var currentSlide = $('.active-slide');
var currentDot= $('.active-dot');
var nextDot= $('.active-dot').next();
var nextSlide = currentSlide.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();
         currentSlide.fadeOut(600).removeClass('active-slide');
         prevSlide.fadeIn(600).addClass('active-slide');
      });
         $('.arrow-prev').click(function () {
             var currentSlide =$('.active-slide');
             var prevSlide = currentSlide.prev();
             if (prevSlid.length==0) {prevSlide=$('.slide').last();}
             currentSlide.fadeOut(600).removeClass('active-slide');
             prevSlide.fadeIn(600).addClass('active-slide');
         });

};
$(document).ready(main);


#2

@tagsolver15272

A bit of problem with the = sign

Alright, here, you want to assign a new value to a variable, we only use one equal sign, not 3(this is comparing things).

Here, you want to test whether prevSlid variable length is equal to 0 so it's a comparison. In javascript, we use three equal signs to compare things while in other languages like Ruby or PHP, we use two equal signs.


#3

thank you very much now it is working