MediaWiki:Common.js: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 103: | Line 103: | ||
/*FIM DO FOOTER*/ | /*FIM DO FOOTER*/ | ||
/* Botão Voltar ao Topo */ | |||
var backToTop = $('<div id="back-to-top" style="display:none; position:fixed; bottom:40px; right:40px; width:50px; height:50px; background-color:#ffffff; color:#000000; border-radius:50%; text-align:center; line-height:50px; font-size:24px; cursor:pointer; z-index:9999; box-shadow: 0 4px 12px rgba(0,0,0,0.3); transition: all 0.3s ease;">↑</div>'); | |||
$('body').append(backToTop); | |||
$(window).scroll(function() { | |||
if ($(window).scrollTop() > 300) { | |||
backToTop.fadeIn(); | |||
} else { | |||
backToTop.fadeOut(); | |||
} | |||
}); | |||
backToTop.click(function() { | |||
$('html, body').animate({scrollTop: 0}, 600); | |||
}); | |||
// Efeito de hover (opcional, para ficar mais profissional) | |||
backToTop.hover( | |||
function() { $(this).css({ 'transform': 'scale(1.1)', 'background-color': '#f0f0f0' }); }, | |||
function() { $(this).css({ 'transform': 'scale(1.0)', 'background-color': '#ffffff' }); } | |||
); | |||