title: jQuery mouseup event on click and drag
body: <p>I'm trying to show a <code>div</code> when the user click a box. I tried to use this code:</p>
  
  <pre><code>$(document).ready(function(){
    $(".hold").mousedown(function(){
      $(".box").css("height","200px");
    });
    $(".hold").mouseup(function(){
      $(".box").css("height","0px");
    });
  });
  </code></pre>
  
  <p>But the second part of the code, the <code>mouseup</code> event doesn't trigger the callback when I click and drag.</p>
  
  <p>How to make it work?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;click and hold project&lt;/title&gt;
      &lt;link rel="stylesheet" type="text/css" href="style.css"&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div class="hold"&gt;&lt;/div&gt;
      &lt;div class="box"&gt;&lt;/div&gt;
  
      &lt;script src="jquery-2.2.3.min.js"&gt;&lt;/script&gt;
      &lt;script src="app.js"&gt;&lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>