Im using a timer to call an ajax function that loads in a response from a seperate php page. I want to make it so the content fades out then fades in with the response ever so often.
Here's my code - i can grab the content and make it change just the fading in part im at a loss with.
<script type="text/javascript">
window.setTimeout('runMoreCode()',100);
$(document).ready(function(){
$('#refreshRecords').fadeIn(2000);
});
function runMoreCode()
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("refreshRecords").innerHTML=xmlhttp.responseText;
$('#refreshRecords').fadeIn('slow');
}
}
xmlhttp.open("GET","NewRecords.php",true);
xmlhttp.send();
setTimeout("runMoreCode()",6000);
}
</script>
I have tried to do it with .fadeIn but with no luck. I have linked in the latest jQuery file as well.
Thanks
GCooper