Created
November 12, 2013 15:06
-
-
Save lucianobragaweb/7432371 to your computer and use it in GitHub Desktop.
Botão Voltar ao topo com deslize suave
This file contains 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
<div id="voltarTopo"> | |
<a href="#" id="subir">Topo</a> | |
</div> |
This file contains 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
// JAVASCRIPT | |
$(document).ready(function() { | |
$('#subir').click(function(){ | |
$('html, body').animate({scrollTop:0}, 'slow'); | |
return false; | |
}); | |
}); |
This file contains 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
#subir{ | |
position:fixed; | |
bottom:0px; | |
right:0px; | |
} |
Show, valeu!!
Show de boleta.
Excelente! Valeeeu!
obrigado
Valeuuu
Amei! Muito grata.
Como poderia centralizar esse objeto? Ao invés de esquerda ou direita, como posso deixar ele no meio?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
valeu ai, me ajudou ;)