Applying jQuery Fade in or Scroll Effect to Facebook Like Newsfeed <p>I have a news feed that has been developed using PHP, MySQL, and jQuery. The news feed does it's job by getting new content every 5 seconds. However, this is done by a "refresh" of the complete content. I want to only ADD any new content to the news feed. I want a fade in or scroll effect to be used (jQuery) for this to occur. The items already loaded should stay on the feed and NOT reload with any new content. How can I do this?</p> <p>Here are my 2 pages and code.</p> <p>feed.php</p> <pre><code> &lt;body &gt; &lt;script&gt; window.setInterval(function(){ refreshNews(); }, 5000); &lt;/script&gt; &lt;div id="news"&gt;&lt;/div&gt; &lt;script&gt; function refreshNews() { $("#news").fadeOut().load("ajax.php", function( response, status, xhr){ if (status == "error"){ } else { $(this).fadeIn(); } }); } &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>ajax.php</p> <pre><code>&lt;?php require_once('../../Connections/f12_database_connect.php'); ?&gt; &lt;?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION &lt; 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } mysql_select_db($database_f12_database_connect, $f12_database_connect); $query_newsfeed_q = "SELECT * FROM newsfeed ORDER BY pk DESC"; $newsfeed_q = mysql_query($query_newsfeed_q, $f12_database_connect) or die(mysql_error()); $row_newsfeed_q = mysql_fetch_assoc($newsfeed_q); $totalRows_newsfeed_q = mysql_num_rows($newsfeed_q); ?&gt; &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt; &lt;title&gt;Untitled Document&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;table border="1"&gt; &lt;tr&gt; &lt;td&gt;pk&lt;/td&gt; &lt;td&gt;title&lt;/td&gt; &lt;td&gt;content&lt;/td&gt; &lt;/tr&gt; &lt;?php do { ?&gt; &lt;tr&gt; &lt;td&gt;&lt;?php echo $row_newsfeed_q['pk']; ?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $row_newsfeed_q['title']; ?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $row_newsfeed_q['content']; ?&gt;&lt;/td&gt; &lt;/tr&gt; &lt;?php } while ($row_newsfeed_q = mysql_fetch_assoc($newsfeed_q)); ?&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; &lt;?php mysql_free_result($newsfeed_q); ?&gt; </code></pre>