MediaWiki:Common.js
De SimplesWiki
Nota: Após publicar, você pode ter que limpar o "cache" do seu navegador para ver as alterações.
- Firefox / Safari: Pressione Shift enquanto clica Recarregar, ou pressione Ctrl-F5 ou Ctrl-R (⌘-R no Mac)
- Google Chrome: Pressione Ctrl-Shift-R (⌘-Shift-R no Mac)
- Internet Explorer/Edge: PressioneCtrl enquanto clica Recarregar, ou Pressione Ctrl-F5
- Opera: Pressione Ctrl-F5.
/* 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);