How to make fadeIn with insertBefore?

https://jsfiddle.net/njb6xmoh/

So to make it fadeIn? With append works fine but why not with insertBefore?

Any idea?

Thanks!

I would use prepend instead.

$('p').prepend('<div>test hello</div>')
$('div').hide().fadeIn(22500, 'linear');

If you want both the p element and the div to fade in at the same time, then you would do:

$('p').prepend('<div>test hello</div>').hide().fadeIn(22500, 'linear');
1 Like

With your example got to work the key was .hide

https://jsfiddle.net/5nfcsdhz/

Thanks!