I want to fade in new posts from my database. I have a div that contains all old posts which are loaded when the page loads, and then I want new posts to fade in above the old ones.
I just got started with jQuery. I´ve tried a few things.
This code doesn’t work. (Which maybe is obvious to you.)
$('#oldMessages').html($('#oldMessages').html() + load('newPosts.php').hide().fadeIn(3000));
Thanks for your help!
As the page loads (or whenever you need to load posts), try this
Edit
This is a little hacky–the code has a couple requirements:
class="timePosted"with each postclass="timeElapsed". If you can’t do this, I think you’ll need an array with some id’s to identify each postSince you also need to update the elapsed times, you could try this inside your
successcallback function: