Question

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?

Was it helpful?

Solution

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();
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top