Created
June 21, 2012 15:29
-
-
Save fabiancarlos/2966390 to your computer and use it in GitHub Desktop.
Pequeno script para subir para topo (JS)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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