Попробуйте вместо этого:
$(document).ready(function() {
if ($.cookie('keuzemanvrouw') == "man" || $.cookie('keuzemanvrouw') == "vrouw" || $.cookie('choice1') == "choiceaman" || $.cookie('choice1') == "choiceavrouw") {
if ($.cookie('keuzemanvrouw') == "man") {
$("#pilotman").show();
$("#pilotvrouw").hide();
$("#choiceavrouw").hide();
$("#choicebvrouw").hide();
$("#choiceaman").hide();
$("#choicebman").hide();
$("#keuzemanvrouw").hide();
} else if ($.cookie('keuzemanvrouw') == "vrouw") {
$("#pilotvrouw").show();
$("#pilotman").hide();
$("#choiceaman").hide();
$("#choicebman").hide();
$("#choiceavrouw").hide();
$("#choicebvrouw").hide();
$("#keuzemanvrouw").hide();
}
if ($.cookie('choice1') == "choiceaman") {
$("#choiceaman").show();
$("#choicebman").hide();
$("#pilotman").hide();
} else if ($.cookie('choice1') == "choiceavrouw") {
$("#choiceavrouw").show();
$("#choicebvrouw").hide();
$("#pilotvrouw").hide();
}
} else {
$("#pilotvrouw").hide();
$("#pilotman").hide();
$("#choiceavrouw").hide();
$("#choiceaman").hide();
$("#choicebvrouw").hide();
$("#choicebman").hide();
}
});
Все ваши if
операторы свисают друг с другом, поэтому choice1
cookie else if
s не будет работать, если keuzemanvrouw
равно man
или vrouw
.else if
s запускается, только если нет других предыдущих операторов if, которые сработали.
Думайте об этом так:
if (false) { // Does check this statement.
// Doesn't run this code.
} else if (true) { // Does check this statement.
// Runs this code.
} else if (true) { // Doesn't check this statement, because the previous one worked.
// Doesn't run this code.
}