1. I beg to differ: it's your use of my reply that doesn't work
2. You can't fadeOut() text context, you can only fade an element.
Therefore if you want to keep the outer div visible, then the inner
text needs to wrapped in something (like another div?), and it's that
'something' that you fade out.
3. Your 'success' property callback needs to be a function, so either
used a named function, eg...

success: hidediv

...or an anonymous function, eg...

success:function(response){ javascript_statements(s); }

...where hidediv is a function that accepts the response as an
argument (as described in the documentation), eg...

function hidediv(response){
  // do something, like a delayed fadeOut maybe...
  setTimeout(function(){ $('#pdresult div').fadeOut('slow'); }, 2000);
} //end function

You could just use the anonymous function to do a (delayed) fade out,
eg...

success:function(response){
    // you might want to do something with the response here as well
    // ...
    setTimeout(function(){ $(pdoptions.target + '
div').fadeOut('slow'); }, 2000);
  }



On Nov 23, 3:44 pm, guix69 <[EMAIL PROTECTED]> wrote:
> Thanks for your reply but it doesn't work.
> I'm using the form plugin with its ajaxForm method so I have these
> options :
>     var pdoptions = { target: '#pdresult', success:
> hidediv('pdresult')};
> and I bind them to the form with :
>     $('#pdform').ajaxForm(pdoptions);
>
> the hidediv function contains the code you gave me :
> function hidediv(name) {
> setTimeout(function(){ $('#'+name).fadeOut('slow'); }, 2000);
>
> };
>
> But with all that, the hidediv function is executed as soon as I load
> the page with the form
> and I can see my empty 'pdresult' div disappear...
>
> So, to sum things up, I would say that I need the CONTENT of the div
> to be faded out a few seconds
> AFTER the form has been succesfully submitted      :)
>
> Thanks again.

Reply via email to