-
-
- Submit Updated Articles to Bing and Yandex with IndexNow in Joomla
- Add Published and Modified Date Meta Tags to Joomla
- Add Open Graph and Twitter Card Tags to Joomla
- Auto-Generate Meta Descriptions from Article Text in Joomla
- Add Noindex to Specific Pages in Joomla
- Verify Your Joomla Site with Google Search Console
-
- Add a View as Markdown Link to Joomla Articles
- Display the Last Modified Date in Joomla Articles
- Embed Iframes in Joomla
- Automatically Link Twitter (X) @mentions in Joomla Articles
- Open External Links in a New Tab in Joomla
- Display Estimated Reading Time in Joomla Articles
- Replace Old URLs in Joomla
- Search and Replace in Joomla
-
- Add a Footer Line to the Joomla Administrator
- Show a Staging Banner in the Joomla Administrator
- Remove the "All" Option from Admin List Limits in Joomla
- Add a Cookie Consent Banner to Joomla
- Make the Administrator Navigation Sticky in Joomla
- Add Google Fonts to Joomla
- Add a Facebook Messenger Chat Button to Joomla
- Add a Reading Progress Bar to Joomla
- Add a Custom Scrollbar to Joomla
- Show Confetti on a Thank You Page in Joomla
- Add Smooth Scrolling to Joomla
- Add a Back to Top Button in Joomla
- Add a WhatsApp Chat Button in Joomla
-
- Protect the Administrator with a Secret URL Key in Joomla
- Show a Welcome Message on First Login in Joomla
- Log Out Idle Administrators in Joomla
- Assign New Users to a Different User Group Automatically in Joomla
- Redirect Visitors by Country in Joomla
- Redirect Users After Login by User Group in Joomla
- Block User Registration with Certain Usernames in Joomla
- Block User Registration by Country in Joomla
- Block User Registration by Email Address in Joomla
- Block User Registration by IP Address in Joomla
- Remove the Forgot Password and Username Links in Joomla
- Remove the Generator Meta Tag in Joomla
- Let Users Log In with Their Email Address in Joomla
- Block Traffic by Country in Joomla
- Block Bot Traffic in Joomla
- Block Traffic by IP Address in Joomla
Add a Reading Progress Bar to Joomla
Show visitors how much of the page is left with a progress bar that fills up as they read your Joomla site, using one HTML snippet.
A thin bar across the top of the screen that fills up as you read shows visitors how much of the page is left. It helps readers pace themselves through long posts. You can add one to your Joomla site with a single HTML snippet in Code Snippets.
The snippet code
This HTML snippet adds the bar, its styling, and a small script that fills it as the visitor scrolls. It measures how far down the page they are, so it works on any page of your site.
<div id="reading-progress" aria-hidden="true"></div>
<style>
#reading-progress {
position: fixed;
top: 0;
left: 0;
z-index: 9999;
width: 100%;
/* Bar height and color */
height: 4px;
background: #4f46e5;
transform: scaleX(0);
transform-origin: left;
pointer-events: none;
}
</style>
<script>
(function () {
var bar = document.getElementById('reading-progress');
var ticking = false;
function update() {
// How far the visitor can scroll on this page.
var scrollable = document.documentElement.scrollHeight - window.innerHeight;
var progress = scrollable > 0 ? window.scrollY / scrollable : 0;
progress = Math.min(1, Math.max(0, progress));
bar.style.transform = 'scaleX(' + progress + ')';
ticking = false;
}
function requestUpdate() {
if (!ticking) {
ticking = true;
requestAnimationFrame(update);
}
}
window.addEventListener('scroll', requestUpdate, { passive: true });
window.addEventListener('resize', requestUpdate);
window.addEventListener('load', requestUpdate);
update();
})();
</script>
Pages too short to scroll keep the bar hidden. To show it only on some pages, like your blog posts, open the Conditional Logic tab and set Display on to Selected Pages. Learn more in Run a snippet on specific pages.
To change the look, edit height and background in the style block. To show the bar at the bottom of the screen, change top: 0; to bottom: 0;.
How to add this snippet
- Install Code Snippets if it isn't installed already.
- Log into your Joomla backend.
- Go to Components → Tassos Code Snippets.
- Click New.
- Enter a title, for example Reading progress bar.
- Set Code Type to HTML.
- Set Insertion Method to Auto-Insert Locations.
- Set Location to Site Footer.
- Paste the code above into the editor.
- Click Save & Close.
Check that it works
- Open a long page on your site.
- Scroll down to the bottom.
The bar should fill from left to right and reach the end at the bottom of the page.
The progress bar pairs well with an estimated reading time and smooth scrolling.
To learn more about HTML snippets, read the HTML snippet docs.