jQuery를 사용하여 내가 만든 "알림"버블을 페이드 아웃합니다. 처음 함수가 호출되면 처음에는 잘 사라지지 만 두 번째에는 "알림"이 본문에 추가되지만 그곳에 그냥 앉아서 페이드 아웃하지 않습니다. 어떤 도움이라도 대단히 감사하겠습니다.jQuery fadeOut() 한 번만 작동
여기에 호출되는 자바 스크립트가 있습니다.
if (pointsCalculated = 1) {
$('body').append('<div id="progress">' + pointsCalculated + ' point added to current points...</div>');
}
else {
$('body').append('<div id="progress">' + pointsCalculated + ' points added to current points...</div>');
}
//Reset calculator after adding to tracker
calcReset();
$("#progress").fadeOut(2000);
동일한 ID를 가진 두 번째 div를 추가하고 div가 있는지 확인하고 fadIn()을 사용하거나 그렇지 않으면 가시성을 변경하고 해당 내용을 편집하십시오. – CBusBus
왜 'if'' else' 문 안에서 두 개의 동일한 연산을 수행하고 있습니까? –
@ RokoC.Buljan 하나가 말하고 다른 하나는 – voigtan