Widget:ScrollToTopFunction: Difference between revisions

From Tsadra Foundation Advanced Contemplative Scholarships
(by SublimeText.Mediawiker)
(by SublimeText.Mediawiker)
Line 3: Line 3:


function event() {
function event() {
var continueButton = document.getElementsByClassName('pf-wizard-continue-button');
var buttons = document.getElementsByClassName('pf-wizard-buttons a');
var backButton = document.getElementsByClassName('pf-wizard-back-button');


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

Revision as of 11:42, 6 June 2023

<script type="text/javascript"> // Scroll to top in Pageforms wizard

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

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