Widget:ScrollToTopFunction: Difference between revisions
(by SublimeText.Mediawiker) |
(by SublimeText.Mediawiker) |
||
| Line 2: | Line 2: | ||
// Scroll to top in Pageforms wizard | // Scroll to top in Pageforms wizard | ||
document.addEventListener("DOMContentLoaded", () => { | |||
var buttons = document.getElementsByClassName('pf-wizard-buttons a'); | var buttons = document.getElementsByClassName('pf-wizard-buttons a'); | ||
Revision as of 12:04, 6 June 2023
<script type="text/javascript"> // Scroll to top in Pageforms wizard
document.addEventListener("DOMContentLoaded", () => { var buttons = document.getElementsByClassName('pf-wizard-buttons a');
buttons.on('click', function(event) { setTimeout(function() {window.scrollTo(0, 0); }, 300 ); }); }); </script>