Fade In New Content on Refresh?
Hello,
I've been working on a AJAX request that gets the last 6 posts from a forum.
As new posts are added the page updates. What I'd like it to do is fade in the new posts at the top of the page. Go easy on me here though I'm quite new to JQuery
so far I have the following. with the forums.php file the file that querys the SQL database and styles the the output.
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Using jQuery</title>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
</head>
<body onload="startAjax()">
<script type="text/javascript">
setInterval("$('#ajax').load('forum.php')", 10000);
</script>
<div id="ajax" style="height: 300px; width: 500px;">
<div id="topics" style="display:none;">
<?php include('forum.php'); ?>
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
$('#topics').fadeIn(2600);
});
</script>
</body>
</html>
Looking forward to any help
