Forum Discussion
Customizing Player
- 1 year ago
It’s a custom tab that can be selected, unselected, or deleted in the Player Properties. When selected or unselected, the tab's state (visibility) applies globally across all slides. To remove the "CONTACT" tab from specific slides, you would need to use JavaScript to target that tab and remove it from those slides only. Execute JavaScript when the timeline starts on this slide:
const tabs = document.querySelectorAll(".custom-link"); tabs.forEach(tab => { let contactTab = tab.querySelector('span') if (contactTab.textContent.trim() === "CONTACT") { tab.style.display = 'none'; // hide } });These buttons each have their own ID that can be targeted individually. However, I used a slightly longer code to target your tab by its text content, as I'm unsure how many custom tabs are in your project.
To ensure the "CONTACT" tab appears on specific slides, execute the JavaScript when the timeline starts on those slides:const tabs = document.querySelectorAll(".custom-link"); tabs.forEach(tab => { let contactTab = tab.querySelector('span') if (contactTab.textContent.trim() === "CONTACT") { tab.style.display = 'inline-block'; // show } });
The first JavaScript goes on the slides where you want the "CONTACT" tab to be invisible, and the second one goes on the slides where you want it visible.
Is the "CONTACT" tab the only tab at the top right corner, or do you have additional tabs like "Resources" or other custom tabs? If I can figure the ID, I can simplify both scripts. Alternatively, I could create a single script for the master slide that automatically toggles the "CONTACT" tab visibility based on certain conditions.
You can try applying both scripts as they are for now and see how it works for you.
Nedim thank you for this code to hide and show custom tabs, I have it working in a project. I do have a question, if I wanted to hide the custom tab when the project loads (there is audio on the first slide), where can I put this code? The tab is not clickable, and disappears as soon as the first slide loads, but it would be best to reveal the tab at a certain point and not show on load. Thanks in advance.
Related Content
- 4 months ago