title: jQuery - Wait till end of SlideUp()
body: <p>How can I wait till the end of the jQuery function slideUp() before continuing the script?</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function() {
      $("div[class=item]").click(function() {
          var id = $(this).attr("id");
          $("#content").slideUp();
          switch(id) {
              // Applications
              case "rampro":
                  $("#content").css("text-align", "left");
                  $("#content").load("inc/pages/rampro.html");
                  $("#content").slideDown();
                  break
              case "diskman":
                  $("#content").css("text-align", "left");
                  $("#content").load("inc/pages/diskman.html");
                  break
              case "iconmap":
                  $("#content").css("text-align", "left");
                  $("#content").load("inc/pages/iconmap.html");
                  break
              // Websites
              case "benoks":
                  $("#content").css("text-align", "left");
                  $("#content").load("inc/pages/benoks.html");
                  break
              case "linkbase":
                  $("#content").css("text-align", "left");
                  $("#content").load("inc/pages/linkbase.html");
                  break
              case "jamesbrooks":
                  $("#content").css("text-align", "left");
                  $("#content").load("inc/pages/jamesbrooks.html");
                  break
              default:
                  $("#content").css("text-align","center");
                  $("#content").html("&lt;h1&gt;something went wrong, try again!&lt;/h1&gt;");
          }
          return false;
      });
  });
  </code></pre>
  
  <p></p>