I'm trying to make the button (number__copy__button) work only when the animation (copy__animation) ends.
So that there are no spam clicks, because the animation will over-loop and will run several times after you press the button (number__copy__button).
My question is:
Can I somehow make this button (number__copy__button) un-pressable until animation (copy__animation) ends?
// ••• Copy Text Animation Fade In •••
$(".number__copy__button").click(function() {
$(".copy__animation").fadeIn(200).delay(2500).fadeOut(200);
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<button class="number__copy__button"></button>
<div class="copy__animation">
Number Copied
</div>