I'd like to know why setimout(fun(),time) is not working here:
Context: This shows a message and Hides it, i'd like to make it wait 2 seconds, but if i do as following it wont hide (normally i do it without the setimeout()
function mostrar_msj(msj){
$('#notificaciones').text(msj);
$('#notificaciones').animate({
top:$(window).scrollTop()+"px"
},
{
queue: false,
duration: 350
});
$("#notificaciones").slideDown(1000, setTimeout('cerrar()',2000));
}
function cerrar(){
$("#notificaciones").fadeOut(2000);
}
I'm just confused, here :?