MediaWiki:Common.js: mudanças entre as edições
De SimplesWiki
(Criou página com '→Códigos JavaScript aqui colocados serão carregados por todos aqueles que acessarem alguma página deste wiki: // Adiciona função para voltar ao topo function addScrollToTopButton() { const button = document.createElement('span'); button.id = 'scrollToTopButton'; button.textContent = '↑'; button.style.cssText = ` display: inline-block; width: 30px; height: 30px; background-color: #007BFF; color: white;...') |
(Sem diferença)
|
Edição das 13h05min de 9 de janeiro de 2025
/* Códigos JavaScript aqui colocados serão carregados por todos aqueles que acessarem alguma página deste wiki */ // Adiciona função para voltar ao topo function addScrollToTopButton() { const button = document.createElement('span'); button.id = 'scrollToTopButton'; button.textContent = '↑'; button.style.cssText = ` display: inline-block; width: 30px; height: 30px; background-color: #007BFF; color: white; font-size: 20px; border-radius: 50%; cursor: pointer; text-align: center; line-height: 30px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); position: fixed; bottom: 20px; right: 20px; z-index: 1000; `; button.addEventListener('click', function () { window.scrollTo({ top: 0, behavior: 'smooth' }); }); document.body.appendChild(button); } // Executa a função quando a página é carregada document.addEventListener('DOMContentLoaded', addScrollToTopButton);