There is a way to do this on your own without ruining other design areas on the website; you might need a professional guide. But if you are sure it can be done on your own, I can provide you with a comprehensive video guide to give you clarity on how to do it without issues. Let me know if that would be helpful. Cheers!
Looks like your theme code was modified by 3rd-party (StealthPack?).
They’ve added an option to auto-change the content on the Announcement Bar every 5 seconds. This is done by imitating a click on the hidden button inside announcement bar.
However, the menu logic closes the menu if visitor clicks anything outside the menu which is what happening every 5 seconds as explained above.
I would try and reconfigure your announcement bar to leave only one message – this should stop this “autoclicking”.
If not, disable announcement bar altogether and see if the problem disappears.
It is possible to change the announcement bar code to avoid “autoclicking”, but you may also wish to contact the developer who has added this first.
Here is the offending code from your site:
// Auto advance every 5 seconds (adjust timing as needed)
setInterval(function() {
// Find the next button and trigger a click on it
const nextButton = document.querySelector('[is="next-button"][aria-controls="announcement-bar"]');
if (nextButton) nextButton.click();
}, 5000);
Actually, you may edit your announcement bar code to fix it:
Remove the auto-advancement JS code there – theme code will do it:
// Auto-advance announcements
document.addEventListener('DOMContentLoaded', function() {
const announcementBar = document.getElementById('announcement-bar');
if (announcementBar && announcementBar.parentElement.querySelectorAll('[is="next-button"]').length > 0) {
// Auto advance every 5 seconds (adjust timing as needed)
setInterval(function() {
// Find the next button and trigger a click on it
const nextButton = document.querySelector('[is="next-button"][aria-controls="announcement-bar"]');
if (nextButton)
nextButton.click();
}, 5000);
}
});
Modify HTML from:
to
```markup
Theme code will loop over your announcement bar messages every 5 seconds all by itself.