I have a simple set of two buttons that when hovered should make a div move up and down to simulate a scrolling effect:
$(\"#down\").hover(function () {
$(\
I think animate
is more useful for single animation effects rather than a continuous and variable change. You can implement this yourself with an interval.
var interval;
$("#down").mouseenter(function () {
interval = setInterval(ScrollDown, 100);
});
$("#down").mouseleave(function () {
clearInterval(interval);
});
function ScrollDown() {
$('.scroll').css("marginTop", "+=50px");
// check bounds here to solve problem #1
}
/* do the same stuff for scrolling up */