How to make fadeIn with insertBefore?

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

Any idea?


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