Rory you need to use the callback functions on your fadeIn/fadeOut
commands. And ouch a FONT tag !

ie ...

$("#txt_user_name_msg").fadeOut(1000, function(){$(this).html('<img
src="/_images/ajax_error.gif" alt="error" /> <span
style="color:#cc0000;">you must enter a username!</span>').fadeIn
(1000);});



On Oct 12, 3:48 pm, rory pickering <rorypicker...@googlemail.com>
wrote:
> how can i create a queue what i want to do is
>
> onblur of a field
>
> 1) fade out current message in a div,
>
> 2)change the message
>
> 3) fade in new message (same div)
>
> when i try to do it it changes the html in the div then fades out and
> then in......
>
> this is the code ive writeen
>
> $("#txt_user_name").blur(function () {
>                 $("#txt_user_name_msg").html('<img 
> src="/_images/ajax_loader.gif"
> alt="O" />');
>
>         if($(this).val() === ''){
>                 $("#txt_user_name_msg").fadeOut(1000);
>                         $("#txt_user_name_msg").html('<font 
> color="#CC0000"><img src="/
> _images/ajax_error.gif" alt="X" /> you must enter a username!</
> font>');
>                 $("#txt_user_name_msg").fadeIn(1000);
>
>                 }else if($(this).val().length < 3){
>                 $("#txt_user_name_msg").fadeOut(1000);
>                         $("#txt_user_name_msg").html('<font 
> color="#CC0000"><img src="/
> adventure_dave/_images/ajax_error.gif" alt="X" /> username too short!</
> font>');
>                 $("#txt_user_name_msg").fadeIn(1000);
>                 }

Reply via email to