This function works fine. It scrolls the body to a desired container‘s offset
function scrolear(destino){
var stop = $(destino).offset().top;
var delay = 1000;
$(‘body‘).animate({scrollTop: stop}, delay);
return false;
}
But not in Firefox. Why?
-EDIT-
To handle de double trigger in the acepted answer, I suggest stoping the element before the animation:
$(‘body,html‘).stop(true,true).animate({scrollTop: stop}, delay);