drag and scroll script
<p>I'm trying to make a scrolling calendar script using jquery (similar to the one on an iPad) </p>

<p>So, I want to record the yPosition of the mousedown and the mouseup and move a div accordingly. I tried recording the mouse positions using two variables, one to be recorded on the mousedown event and one to be recorded on a mouseup event... </p>

<p>but right now the problem is that the variable value is not carried through, so on the mouseup the value of the mousedown is back to 0. what would I do to carry the value?</p>

<p>Thanks a lot in advance! </p>

<p>The code is below:</p>

<pre><code>jQuery(document).ready(function(){
var yStart = 0;
var yEnd = 0;
$("#year").mousedown (function(e){
    var yStart = e.pageY;
    $(".yStart").text (yStart +"ho"+ yEnd);
    }).mouseup (function(e){
        var yEnd = e.pageY;
        $(".yEnd").text (yStart +"ho"+ yEnd);
    });
    if (yStart&gt;yEnd) {
    $("#year ul").animate({top:'-='+liHeight},"fast");  
};
</code></pre>
