title: jQuery is mousedown on mouseover
body: <p>I have a table where i want to change cell background on mouse over and mouse button down, my current solution doesn't work as I want it to :</p>
  
  <pre><code>function ChangeColor(sender) {
  
      sender.style.backgroundColor = 'yellow';
  
  }
  
  var clicking = false;
  
  
  $(document).mouseup(function() {
      clicking = false;
  });
  
  
  $(document).ready(function() {
      $('#Table1 tr').each(function() {
          $('td', this).each(function() {
              $(this).mousedown(function() {
                  clicking = true;
              });
              $(this).mousedown(function(event) {
                  if (clicking==true) { ChangeColor(this); }
              });
          });
      });
  });
  </code></pre>
  
  <p>Is there any way to make it work like that ?</p>