I have a div which is already displaying some html. I'd like to replace the contents of the div with some different html. However, I'd like the transition to have an effect, such as a fade-in.
I've tried this:
$('#mydiv').html('Some new text').fadeIn(1500);
but the transition happens immediately, with no fade effect. Can this be done?
Thanks
Try this
$('#mydiv').hide().html('Some new text').fadeIn(1500);
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