diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js index 3fb6a88a87..93e8fcef80 100644 --- a/phpBB/styles/prosilver/template/ajax.js +++ b/phpBB/styles/prosilver/template/ajax.js @@ -392,6 +392,28 @@ $('#member_search').click(function () { return false; }); +/** + * Show to top button if available on page + */ +const $scrollTopButton = $('.to-top-button'); + +if ($scrollTopButton.length) { + // Show or hide the button based on scroll position + $(window).scroll(function () { + if ($(this).scrollTop() > 300) { + $scrollTopButton.fadeIn(); // Fade in the button + } else { + $scrollTopButton.fadeOut(); // Fade out the button + } + }); + + // Scroll smoothly to the top when the button is clicked + $scrollTopButton.click(function (e) { + e.preventDefault(); // Prevent the default anchor link behavior + $('html, body').animate({scrollTop: 0}, 500); // Smooth scroll to top + }); +} + /** * Automatically resize textarea */ diff --git a/phpBB/styles/prosilver/template/faq_body.html b/phpBB/styles/prosilver/template/faq_body.html index 4f925fa6a2..542e894c61 100644 --- a/phpBB/styles/prosilver/template/faq_body.html +++ b/phpBB/styles/prosilver/template/faq_body.html @@ -35,9 +35,6 @@