Hello.
function checkSession(){
$.ajax({url: "session.php", success: function(data){
if( data == 1){
var postFilen = 'msg.php';
$.post(postFilen, function(data){
$(".msg").html(data).find(".message2").fadeIn("slow")
}else{
$('.msg').hide();
}
}});
// setInterval('checkSession()',1000);
Now i want to place to fadeout .msg after 5 seconds it has been shown. How do i do this.. i have tried:
function checkSession(){
$.ajax({url: "session.php", success: function(data){
if( data == 1){
var postFilen = 'msg.php';
$.post(postFilen, function(data){
$(".msg").html(data).find(".message2").fadeIn("slow")
setTimeout(function() {
$('.msg').fadeOut('slow');
}, 5000);
});
}else{
$('.msg').hide();
}
}});
// setInterval('checkSession()',1000);
}
But then the message wont appear after 1st time..