Abaixo temos o código (os dados mais importantes estão "comentados" em maiúsculas:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$(window).scroll(function() {
if($(this).scrollTop() > 600) { /* NÚMERO DE PIXELS EM QUE O BOTÃO APARECE */
$('#back-top').fadeIn();
} else {
$('#back-top').fadeOut();
}
});
$('#back-top').click(function() {
$('body,html').animate({scrollTop:0},1000); /* 1000=TEMPO DE ROLAGEM EM MILISSEGUNDOS */
});
});
</script>
<style type="text/css">
/* Aparência do botão */
#back-top {
cursor: default; /* TIPO DE CURSOR */
display: none;
position: fixed;
right: 20px; /* POSIÇÃO HORIZONTAL DO BOTÃO */
bottom: 20px; /* POSIÇÃO VERTICAL DO BOTÃO */
height: 40px; /* ALTURA DO BOTÃO */
width: 40px; /* LARGURA DO BOTÃO */
background: url(URL DA IMAGEM DO BOTÃO) center, #4b8df9; /* IMAGEM E COR DO BOTÃO */
border: 1px solid #750cbb; /* LARGURA, TIPO E COR DA BORDA */
z-index: 999;
box-shadow: 12px 12px 12px #1c4e5f; /* POSIÇÃO E COR DA SOMBRA */
border-radius: 6px; /* RAIO DE ARREDONDAMENTO DOS CANTOS */
-webkit-transition: .5s; /* TEMPO DE TRANSIÇÃO */
transition: .5s; /* TEMPO DE TRANSIÇÃO */
}
/* Aparência do botão com o cursor do mouse em cima */
#back-top:hover {
background-color: #ee1133; /* COR DO BOTÃO */
box-shadow: 12px 12px 12px #6f261c; /* POSIÇÃO E COR DA SOMBRA */
-webkit-transition: .5s; /* TEMPO DE TRANSIÇÃO */
transition: .5s; /* TEMPO DE TRANSIÇÃO */
}
</style>


Para adicionar o código no seu blog vá em Layout:

Clique em Adicionar um gadget:

Clique em HTML/JavaScript:

Cole o código e clique em Salvar.

Para terminar clique em Modelo:

Clique em Editar HTML:

Procure pela tag </body>, cole o código abaixo antes dela:
<div id="back-top"></div>
Para finalizar clique em Salvar modelo.

Para evitar transtornos sempre faça um backup do template de seu blog antes de qualquer alteração no seu código.
Nenhum comentário :
Postar um comentário