#6. Keyboard Shortcuts - Interactive Website


#1



https://www.codecademy.com/courses/web-beginner-en-4hxyb/0/6?content_from=make-an-interactive-website%3Ajquery-events#


JS Errors:
Uncaught [object Event] JS1
Mixed Content: The page at JS2

The N & O short cuts do not work - can't find where I am going wrong


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 = currentArticle.next();
      
      currentArticle.removeClass('current');
      nextArticle.addClass('current');
    };
  });
}

$(document).ready(main);


#2

@carynligon,
Have you tried a Refresh Browser
Maybe you could mention which Browser & Version you are using....

++++ reset of session *****************
As you are manipulating with objects
under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser

and

Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

Addendum
General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).
CTRL 0 to reset browser zoom


#3

Still not seeming to work.


#4

@carynligon,
what about....