Forum Discussion
Toggle Play button mid-scene
I have a slide that plays video narrative for half the scene, then pauses the timeline until the user clicks the button. While paused, I do not want the user to be able to avoid the button by pressing Play, so I've used javascript to hide the play/pause button in the player. However, I've been unsuccessful getting the button to reappear when the slide resumes.
When timeline reaches cue1, execute javascript:
document.getElementById('play-pause').style.visibility = "none";
When timeline reaches cue2, execute javascript:
document.getElementById('play-pause').style.visibility = "inline";
If I do a slide with only these triggers and no other slide functionality, it works. But, using my actual slide with animated shapes and click triggers, it's ignoring cue2.
Are you sure you don't want to use visibility = "hidden" and visibility = "visible"? The keywords "none" and "inline" normally go with display rather than visibility.
- Nathan_HilliardCommunity Member
Are you sure you don't want to use visibility = "hidden" and visibility = "visible"? The keywords "none" and "inline" normally go with display rather than visibility.
- HoneyTurnerCommunity Member
I've confirmed, your solution works. It looks like I may have had a combination of visibility and display during my testing, giving me inconsistent results. Now that it's all properly paired, it's working.
Hide:
document.getElementById('play-pause').style.visibility = "hidden";
Show:
document.getElementById('play-pause').style.visibility = "visible";
- HoneyTurnerCommunity Member
I did a quick test on a new slide and hidden/visible worked. I won't have a chance to test in my original scenario until later. 🤞