title: Jquery Combine SlideUp/Down and on click
body: <p>I have created two scripts, one which has slide up and slide down commands which work on timers when the page is loaded. The second is a click event where a slideup/down command is executed when a link is clicked. Both these scripts work separately but I cannot get them to work together.</p>
  
  <p>Here is the timed slideup/down script:</p>
  
  <pre><code>$(document).ready(function() {
      $('.slide-out-div').hide();
      $('.slide-out-div')
          .delay(5000)
          .slideDown(300);
      $('.slide-out-div')
          .delay(5000)
          .slideUp(500);
  });
  </code></pre>
  
  <p>Here is the click script:</p>
  
  <pre><code>window.onload = function() {
      $(document).('#clickme').click(function () {
          if ($('.slide-out-div').is(":hidden")) {
              $('.slide-out-div').slideDown("slow");
          } else {
              $('.slide-out-div').slideUp("slow");
          }
      });
  };
  </code></pre>
  
  <p>How this is supposed to work is when the page is loaded the box slides down after a few seconds, then if the box is not used it slides up after a few seconds. At this point the link can be clicked to make the box slide up or down depending on its current position.</p>
  
  <p>Any help getting these two to work in combination is greatly appreciated :)</p>