I have my code here that checks if there is a new post on my image table.
When I have a new post and my timestamp changes, I want a div to slide down saying there are new updates, like in this picture:
setInterval('checkForUpdates', 30000);
var lastTime = (new Date()).getTime();
function checkForUpdates() {
$.get('image.php?timestamp=' . lastTime
, function (results) {
if (results) { /* fade into dom */ }
}
);
lastTime = (new Date()).getTime();
}