Widget:ScrollToTopFunction

From Tsadra Foundation Advanced Contemplative Scholarships
Revision as of 12:07, 6 June 2023 by Jeremi (talk | contribs) ((by SublimeText.Mediawiker))

<script type="text/javascript"> function docReady(fn) {

   // see if DOM is already available
   if (document.readyState === "complete" || document.readyState === "interactive") {
       // call on next available tick
       setTimeout(fn, 1);
   } else {
       document.addEventListener("DOMContentLoaded", fn);
   }

} docReady(function() { var buttons = document.getElementsByClassName('pf-wizard-buttons a');

buttons.on('click', function(event) { setTimeout(function() {window.scrollTo(0, 0); }, 300 ); }); }); </script>