views:

27

answers:

1

Hello, I'm looking to have a slide down animation (popular on a lot of forms these days) with jquery. I have text injecting into a div. The text is fetched from a database.

   success: function(text, textS, xhr){
    if(xhr.status){
     if (text == "") {
      $("#resultsDiv").html(" ");
     }
     else {
      $("#resultsDiv").html(text.replace(/\+/g,"<br/>"));
     }
    }
   },

What do you think is the best way to go about implementing an animation into this process?

+3  A: 

A quick look in the manual would have shown you what to do:

if (text == "") {
    $("#resultsDiv").html(" ").slideUp();
} else {
    $("#resultsDiv").html(text.replace(/\+/g,"<br/>")).slideDown();
}
Eran Galperin