jQuery scroll a div up and down using two buttons
<p>I have a simple set of two buttons that when hovered should make a div move up and down to simulate a scrolling effect:</p>

<pre><code>$("#down").hover(function () {

    $('.scroll').animate({ "marginTop": "-=50px" }, "fast");

});

$("#up").hover(function () {

    $('.scroll').animate({ "marginTop": "+=50px" }, "fast");

});
</code></pre>

<p>However I have two issues:</p>

<p>1.) I need it to stop when it gets to the end and then hide the button so they know they've reached the end</p>

<p>2.) It needs to scroll continually when the user has their mouse over, currently it does it just once on mouse over and then runs it again on mouse leave.</p>

<p>3.) If the content does not exceed the parent element height then hide both buttons as we don't need to scroll it.</p>

<p>Can anyone help?</p>

<p>I was thinking that perhaps 1 could be solved by finding out the height of the scroll panel and judging its offset to its parent element that holds it and creates the framed view?</p>

<p>Thanks</p>
