Making a quiz game which have 4 answer. In 1st question, after choosing correcting one, hover (background color) not working on previous answer option (in next question) while hover working fine on other 3 option. If next question success, then hover again not working on previous chosen option. Whats the problem????
HTML HERE:
<div id="answer-box container">
<div class="row">
<div id="answer-one" class="answer col-md-4" data-bind="click: function() { answerQuestion(0, $element.id) }">
<span class="big-text">A. </span><span data-bind="text: getAnswerText(0)" class="anshover"></span>
</div>
<div id="answer-two" class="answer col-md-4" data-bind="click: function() { answerQuestion(1, $element.id) }">
<span class="big-text">B. </span><span data-bind="text: getAnswerText(1)"></span>
</div>
</div>
<div class="row">
<div id="answer-three" class="answer col-md-4" data-bind="click: function() { answerQuestion(2, $element.id) }">
<span class="big-text">C. </span><span data-bind="text: getAnswerText(2)"></span>
</div>
<div id="answer-four" class="answer col-md-4" data-bind="click: function() { answerQuestion(3, $element.id) }">
<span class="big-text">D. </span><span data-bind="text: getAnswerText(3)"></span>
</div>
</div>
</div>
CSS HERE:
.answer:hover {
text-decoration: none;
cursor: pointer;
background: #FF7E00;
}
JS HERE:
self.rightAnswer = function(elm) {
$("#" + elm).slideUp('slow', function() {
startSound('rightsound', false);
$("#" + elm).css('background', 'green').slideDown('slow', function() {
self.money($(".active").data('amt'));
if(self.level() + 1 > 15) {
$("#game").fadeOut('slow', function() {
$("#game-over").html('You Win!');
$("#game-over").fadeIn('slow');
});
} else {
self.level(self.level() + 1);
$("#" + elm).css('background', 'none');
$("#answer-one").show();
$("#answer-two").show();
$("#answer-three").show();
$("#answer-four").show();
self.transitioning = false;
}
});
});
}