Bem... uma vez sendo o que você quer, então vou traduzir o conteúdo aqui:
1- Crie uma
<div>, conforme mostrado abaixo...
... e coloque-a no
overall_footer.html de seu estilo em uso, antes da tag
</body>, no final do arquivo.
2- As linhas abaixo configuram o estilo do botão:
Código: Selecionar todos
#toTop {
width:100px;
border:1px solid #ccc;
background:#f7f7f7;
text-align:center;
padding:5px;
position:fixed; /* this is the magic */
bottom:10px; /* together with this to put the div at the bottom*/
right:10px;
cursor:pointer;
display:none;
color:#333;
font-family:verdana;
font-size:11px;
}
Elas podem ser incluídas no arquivo
overall_header.html OU no arquivo
buttons.css do
Prosilver OU no
stylesheet.css do
Subsilver2. Para incluí-las no
overall_header.html, tem de colocá-las entre as tags
<style></style>, ficando desta forma:
Código: Selecionar todos
<style>
#toTop {
width:100px;
border:1px solid #ccc;
background:#f7f7f7;
text-align:center;
padding:5px;
position:fixed; /* this is the magic */
bottom:10px; /* together with this to put the div at the bottom*/
right:10px;
cursor:pointer;
display:none;
color:#333;
font-family:verdana;
font-size:11px;
}
</style>
... e inseri-las antes da tag
</head>.
3- O código
JQuery abaixo é para ser incluído antes da tag
</head>, no
overall_header.html:
Código: Selecionar todos
<script src="{T_THEME_PATH}/jquery.js"></script>
<script type="text/javascript">
$(function() {
$(window).scroll(function() {
if($(this).scrollTop() != 0) {
$('#toTop').fadeIn();
} else {
$('#toTop').fadeOut();
}
});
$('#toTop').click(function() {
$('body,html').animate({scrollTop:0},800);
});
});
</script>
OBS: Se você já tem o arquivo
jquery.js em alguma pasta de seu Fórum, então altere para o respectivo endereço na linha
<script src="{T_THEME_PATH}/jquery.js"></script>, no código acima.
Se não o tiver, então, baixo o arquivo compactado abaixo, descompacte-o e faça upload do arquivo
jquery.js para a pasta
/theme de seu estilo em uso.
jquery.zip
:arrow: Funciona no
Google Chrome 17.0,
Firefox 10.2 e no
IE8.
Fonte: ‘Back to top’ link using jQuery
Agora, para trocar o texto do botão por uma imagem ou ícone, no
item 1, substitua o texto
^ Voltar ao Topo por:
<img src="./endereço da imagem ou ícone" style="width:00px; height:00px">.
Repare que
width e
height estão com
2 zeros, necessitando ser substituídos pela largura e altura da imagem ou ícone caso esta seja grande. Se a imagem ou ícone já estiver no tamanho certo, então, pode eliminar o texto
style="width:00px; height:00px da linha.
Além disso, as configurações do botão devem ser alteradas para:
Código: Selecionar todos
#toTop {
position: fixed;
bottom: 5px;
right: 5px;
cursor: pointer;
}
Abraço.
