Skip to content

Instantly share code, notes, and snippets.

@fabiancarlos
Created June 21, 2012 15:29
Show Gist options
  • Save fabiancarlos/2966390 to your computer and use it in GitHub Desktop.
Save fabiancarlos/2966390 to your computer and use it in GitHub Desktop.
Pequeno script para subir para topo (JS)
//element - elemento que ao clicar, sobe ao topo automaticamente e suavamente ex: $('#subir')
function subirSuavemente(element){
"use strict";
element.click(function(event){
$('html, body').animate({scrollTop:0}, 'slow');
event.preventDefault();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment