I want to make some divs race
<p>So maybe this is kind of juvenile, but I'm still learning Jquery. I've got a couple of DIVs (50x50px absolutely positioned) and this code makes them move across the screen.
I want to make it so if you click on the green box it reduces the interval thereby moving faster. Obviously I'm doing something wrong here, I'm just not sure what.</p>

<pre><code>$(document).ready(function(){
  var greenSpeed = 300;
  var redSpeed = 300;
  var redLeft = $('#red').offset().left;
  setInterval(function() {
    $('#red').css('left', ++redLeft);
    }, redSpeed);
  var greenLeft = $('#green').offset().left;
  setInterval(function() {
    $('#green').css('left', ++greenLeft);
    }, greenSpeed);
  $('#green').click(function() {--greenSpeed});
});
</code></pre>
