단순히 내가 다른 버튼을 클릭 할 때 내가 버튼을 클릭하면 애니메이션 숨겨진되어야 div
이 적용되지 않습니다 : 내가 눈치 무엇easeOutBounce 효과는 항상
<div id="popup"></div>
<input type="button" value="show and animate popup" onClick="showWithAnimation()" />
<input type="button" value="hide" onClick="aFunction()" />
<script>
function showWithAnimation(){
console.log('animation called');
$('#popup') .animate({top:(($(window).height()/2)-($('#popup').outerHeight()/2))-70}, 1000, 'easeOutBounce');
$('#popup').show();
}
function aFunction(){//Hide the div
$('#popup').hide();
}
</script>
, 바운스 효과가 있다는 것이다 처음에 show and animate popup
을 클릭 한 다음에 hide
버튼을 클릭 한 다음 show and animate popup
버튼을 다시 클릭하면 div
버튼이 다시 표시되지만 easeOutBounce
효과는 나타나지 않습니다. div
에만 적용됩니다. 어떻게 해결할 지 물어봐도 될까요? 고맙습니다.
고맙습니다. 고맙습니다. 당신의 설명을 잘 이해하지 못했지만 작동합니다. 다른 방법으로 다시 설명해 주시겠습니까 :) – Malloc
답변을 업데이트했습니다. 무슨 일이 일어나는지 설명하는 데 도움이되기를 바랍니다. 요점은 div를 닫을 때 div가 숨겨져 있어도 여전히 animate에 지정된 대상 위치에 있다는 것입니다. – Ian