Forum Discussion
Mysk
10 months agoCommunity Member
Javascript for placing masterslide on top not working
Hi I am using this javascript to place objects on masterslide on top. It works for the first slide that is using the masterslide but not the rest? Any idea why? The code document.querySele...
Mysk
10 months agoCommunity Member
Thank you. I will look into it.
I modified the script and used this one and it seems to do the trick
function bringHeaderToFront() {
var header = document.querySelector('[data-acc-text="header"]');
if (header) {
header.style.zIndex = "9999";
console.log("Header found and zIndex updated");
} else {
console.log("Header not found");
}
}
// Run on first slide load
bringHeaderToFront();
// Also detect when a new slide loads
var observer = new MutationObserver(function() {
bringHeaderToFront();
});
observer.observe(document.body, { childList: true, subtree: true });