Lesson 4 and 5


#1

I'm using same code at lessons 4 and 5 but at lesson 5 preview doesn't work. At lesson 4 code works without any problem. Why so?

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

$(document).ready(main);


#2

Hi @justbro95,

Are you getting any error messages too, or is the code just not doing anything?


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.