{"action":"opened","issue":{"url":"https://api.github.com/repos/ga-dc/pbj-project1/issues/131","labels_url":"https://api.github.com/repos/ga-dc/pbj-project1/issues/131/labels{/name}","comments_url":"https://api.github.com/repos/ga-dc/pbj-project1/issues/131/comments","events_url":"https://api.github.com/repos/ga-dc/pbj-project1/issues/131/events","html_url":"https://github.com/ga-dc/pbj-project1/issues/131","id":95095682,"number":131,"title":"Click Event Function Disabled","user":{"login":"siltastic","id":10377524,"avatar_url":"https://avatars.githubusercontent.com/u/10377524?v=3","gravatar_id":"","url":"https://api.github.com/users/siltastic","html_url":"https://github.com/siltastic","followers_url":"https://api.github.com/users/siltastic/followers","following_url":"https://api.github.com/users/siltastic/following{/other_user}","gists_url":"https://api.github.com/users/siltastic/gists{/gist_id}","starred_url":"https://api.github.com/users/siltastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siltastic/subscriptions","organizations_url":"https://api.github.com/users/siltastic/orgs","repos_url":"https://api.github.com/users/siltastic/repos","events_url":"https://api.github.com/users/siltastic/events{/privacy}","received_events_url":"https://api.github.com/users/siltastic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-15T03:22:56Z","updated_at":"2015-07-15T03:22:56Z","closed_at":null,"body":"https://github.com/siltastic/trivia-game/blob/master/js/main.js#L60-L97\r\n\r\nAfter exploring with adding and removing classes through jQuery, I was able to achieve half of my goal. My goal was to have my trivia questions slide in from the right, then slide to the left and disappear when the user clicked on an answer. I also wanted to remove the trivia questions in my html to be replaced with the next question (it works). Unfortunately, I broke my click event function and only half my animation is working. The function won't loop through my correct answers array after the first question and won't visibly show animating to the left. I've tried using a \".delay()\"; which helped to show the animation, but created an issue. I refactored my code and solved many minor issues, but the main one was my click event function.\r\n\r\n```javascript\r\n// Create an array of all the correct answers.\r\nvar correctAnswers = [\"De Stijl\", \"Jacque-Louis David\", \"The Napoleonic Wars\"];\r\n\r\n// Add an event listener to all <li> tags.\r\n$(\".choice\").click(function() {\r\n  console.log(\"this =\", this);\r\n\r\n  $(\".trivia-container\").removeClass(\"fade-in\");\r\n  $(\".trivia-container\").addClass(\"fade-out\").remove();\r\n\r\n  // Match answers to the individual <li> tags.\r\n  var userChoice = $(this).text();\r\n  console.log(userChoice);\r\n\r\n  // Loop through all the answers in the \"correctAnswers\" array.\r\n  for (var i = 0; i < correctAnswers.length; i++) {\r\n\r\n    // If the answer is correct ...\r\n    if (correctAnswers[i] === userChoice) {\r\n      console.log(\"Answer is correct!\");\r\n      // Append the \"correct\" class.\r\n\r\n      // Add 1 point to each correct answer.\r\n      $(\"#trivia-score\").html(function(i, val) {\r\n        return val * 1 + 1;\r\n        console.log(\"Added 1pt.\");\r\n      }); // Closes \"trivia-score\"\r\n    }; // Closes \"if\" statement\r\n  }; // Closes \"correctAnswers\" \r\n\r\n  index++;\r\n  createQuestion();\r\n\r\n}); // Closes \".click\"\r\n```"}}