N shortcut 2: help! variable undefined


#1

I'm getting this error message: "Make sure you have defined all the variables!"

But I thought I had... not sure what the issue is! Any help would be greatly appreciated :slight_smile:

var main = function() {
        $("article").click(function() {
            $("article").removeClass("current");
            $("description").hide();
            $(this).addClass("current");
            $(this).children('description').show();
        });
        $(document).keypress(function(event) {
        if(event.which===111) {
            $('.current').children('.description').toggle();
        }
        else if(event.which === 110) {
            var currentArticle = $('.current');
            var nextArticle = current.Article.next();
            currentArticle.removeClass('current');
            nextArticle.addClass('current');
            
        }
        
        });
    }

    $(document).ready(main);

#2

@cmiya

Have a close look at

current.Article


#3

Got it! That was a stupid mistake. Thanks!


#4

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