Say I have img element:
<img id='someimage'>
<script>
$('#someimage').fadeOut(3000);
$('#someimage').hide();
</script>
I want to hide instruction to get executed only after the fadeOut time is over.
You should just check jQuery documentation ;) [LINK]. Use callback as the second argument of fadeOut()
function.
Code:
<script>
$('#someimage').fadeOut(3000, function() {
$(this).hide();
});
</script>
But, for the record, fadeOut()
function will hide particular element anyway. There is no need to use hide()
additionally for img#someimage
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With