I've got a hopefully simple problem. I've got a function that I give a user message, it displays the message in a predefined div. However, if another message comes along too quickly it changes the message, but then fades out and back in again.
This is where I am right now;-
function readUserMessage(message) {
if($('#userMessage').is(':visible')) {
$('#userMessage').fadeOut(200).html("<span style=\"\">" + message + "</span>").fadeIn(300).delay(3000).fadeOut(300);
} else {
$('#userMessage').html("<span style=\"\">" + message + "</span>").fadeIn(300).delay(3000).fadeOut(300);
}
}
Any help really appreciated.