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