title: Naming Functions in jQuery
body: <p>So I just started with jQuery and the functions are confusing me. I want to be able to just name a jQuery function and then call it, without saying when it should be called in the function. I've looked and I can't seem to understand any of the answers. My code is below:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
          $(function() {
              $('a').click(function() {
                  $('#box').slideUp();
  
              });
          });
      &lt;/script&gt;
  </code></pre>
  
  <p>I want it to do something more like this however:</p>
  
  <pre><code>$(function slideBox() {
          $('#box').slideUp();
      });
      &lt;/script&gt;
  </code></pre>
  
  <p>And then call it through a OnClick event or something on a button.</p>