{"action":"created","issue":{"url":"https://api.github.com/repos/ga-dc/project1/issues/184","labels_url":"https://api.github.com/repos/ga-dc/project1/issues/184/labels{/name}","comments_url":"https://api.github.com/repos/ga-dc/project1/issues/184/comments","events_url":"https://api.github.com/repos/ga-dc/project1/issues/184/events","html_url":"https://github.com/ga-dc/project1/issues/184","id":113619593,"number":184,"title":"Keydown event listener","user":{"login":"starrchen","id":13291586,"avatar_url":"https://avatars.githubusercontent.com/u/13291586?v=3","gravatar_id":"","url":"https://api.github.com/users/starrchen","html_url":"https://github.com/starrchen","followers_url":"https://api.github.com/users/starrchen/followers","following_url":"https://api.github.com/users/starrchen/following{/other_user}","gists_url":"https://api.github.com/users/starrchen/gists{/gist_id}","starred_url":"https://api.github.com/users/starrchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/starrchen/subscriptions","organizations_url":"https://api.github.com/users/starrchen/orgs","repos_url":"https://api.github.com/users/starrchen/repos","events_url":"https://api.github.com/users/starrchen/events{/privacy}","received_events_url":"https://api.github.com/users/starrchen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-10-27T16:05:17Z","updated_at":"2015-10-27T19:35:50Z","closed_at":null,"body":"I am trying to have my div.next pass a function on mouseclick and on keydown of the enter key when the div is visible. (It is hidden until an answer is chosen.)\r\n\r\nRight now, it works on mouseclick, but the keydown function still proceeds to the next question even when the div is hidden.\r\n\r\n```javascript\r\nvar onNext = function(){\r\n  questionCount++;\r\n  addQuestion();\r\n  addAnswers();\r\n  $(\".right-or-wrong\").hide();\r\n  $(\".next\").hide();\r\n  $(\".answer\").css(\"color\", \"black\");\r\n  clickCount = 0;\r\n  chooseAnswer();\r\n\r\n// for the last question, next box changes to a \"game over\" box\r\n  if (questionCount >= (triviaPrompts.length - 1)) {\r\n    $(\".next\").on(\"click\", function(){\r\n      window.open(\"https://www.youtube.com/v/v4IC7qaNr7I&autoplay=1\", \"_blank\");\r\n    });\r\n      // $(\".next\").html(\"<a href='https://www.youtube.com/v/v4IC7qaNr7I&autoplay=1' target='_blank'>\" + \"Game over! \" + \" <p class = 'fa fa-play-circle'></p>\" + \"</a>\");\r\n    }\r\n};\r\n\r\n$(\".next\").on(\"click\", onNext);\r\n$(\"html\").on(\"keydown\", function(e){\r\n  if ($(\".next\").css(\"style\") !== \"display:none\"){\r\n    if (e.keyCode == 13) {\r\n      onNext();\r\n      console.log(\"enter\");\r\n    }\r\n  }\r\n});\r\n```\r\n\r\nI'm also struggling to get that div to open a window when it changes to game over. Not sure why it's not working. :("},"comment":{"url":"https://api.github.com/repos/ga-dc/project1/issues/comments/151619578","html_url":"https://github.com/ga-dc/project1/issues/184#issuecomment-151619578","issue_url":"https://api.github.com/repos/ga-dc/project1/issues/184","id":151619578,"user":{"login":"RobertAKARobin","id":6268177,"avatar_url":"https://avatars.githubusercontent.com/u/6268177?v=3","gravatar_id":"","url":"https://api.github.com/users/RobertAKARobin","html_url":"https://github.com/RobertAKARobin","followers_url":"https://api.github.com/users/RobertAKARobin/followers","following_url":"https://api.github.com/users/RobertAKARobin/following{/other_user}","gists_url":"https://api.github.com/users/RobertAKARobin/gists{/gist_id}","starred_url":"https://api.github.com/users/RobertAKARobin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobertAKARobin/subscriptions","organizations_url":"https://api.github.com/users/RobertAKARobin/orgs","repos_url":"https://api.github.com/users/RobertAKARobin/repos","events_url":"https://api.github.com/users/RobertAKARobin/events{/privacy}","received_events_url":"https://api.github.com/users/RobertAKARobin/received_events","type":"User","site_admin":false},"created_at":"2015-10-27T19:35:50Z","updated_at":"2015-10-27T19:35:50Z","body":"Yeah, I'll come find you"}}