이것은 너무 오랫동안 코드를 쳐다보고 중요한 것을 놓친 또 다른 인스턴스입니다. 기본적으로 WebKit에서 .click (jQuery) 이벤트가 발생하면 클릭 된 항목의 내용으로 다른 스크립트를 채 웁니다. 그러나 어떤 이유로 항목을 여러 번 클릭하면 DOM 요소가 삭제됩니다. 어떤 아이디어? 아래에 링크 된 코드 샘플을 가진 JSFiddle.:Javascript가 DOM 요소를 삭제합니다.
$(".vote-divs .vote-div").click(function() {
$(".vote-none").hide()
$(".step-2-column-left .vote-div").each(function() {
$(this).hide();
});
$("#" + $(this).attr("id") + "-s").show();
$(".confirm-s").each(function() {
$(this).hide();
});
if ($(this).attr("id") == "vote-grow") {
$("#donation-vote-for").val("Grow");
$("#confirm-grow-s").show();
} else if ($(this).attr("id") == "vote-stache") {
$("#donation-vote-for").val("Stache");
$("#confirm-stache-s").show();
} else if ($(this).attr("id") == "vote-shave") {
$("#donation-vote-for").val("Shave");
$("#confirm-shave-s").show();
} else if ($(this).attr("id") == "vote-mutton") {
$("#donation-vote-for").val("Mutton");
$("#confirm-mutton-s").show();
} else if ($(this).attr("id") == "vote-manchu") {
$("#donation-vote-for").val("Manchu");
$("#confirm-manchu-s").show();
}
console.log(event.target);
$(".vote-none").html(event.target);
goTo("3");
});
삭제되거나 숨겨져 있습니다 ... ?? –