Trigger the Modern Player to expand the menu (to view) from a button

Nov 16, 2023

I would like to make the Modern Player Menu to expand (sliding-in from left to right in the player, to be in view) from a button in the master slide. This is similar an effect than clicking on the three vertical bars in the top-left of the player, but from inside the slide, on what is effectively an object trigger. Is that at all possible? I am trying to create this effect that was present in previous modules (developed with the Classic Player, by someone that is not there anymore) in my client organization and we would like to transition gradually, so learner get used to the modern player gradually and seamlessly. Thanks for any tips in advance. Cheers Andy

3 Replies
Steve Gannon

The following JavaScript (placed in an Execute JavaScript trigger), which was provided a while back from another community member, should do the trick. It hides the three vertical bars at the top of the player and toggles the menu/sidebar on/off via your button.

//Turn off the hamburger 'menu' icon
let hamburger = document.querySelector("#hamburger > div");
gsap.set(hamburger, { autoAlpha:0 });

//Toggle the sidebar on/off
document.querySelector("#hamburger > div").click();

Andrea Borsoi

Dear Steve,

Thanks you SO much for it! It worked well and alsowith  the second part alone works well (I may leave both 'hamburgers' for a while - the icon in the slide is also the 'hamburger'....I did not know that was the name....funny, if only a little mouthwatering :-) - until people get used to the new player. So I have an interim step....between old and new. Thank you so much!!! I learn so much from you and others and I am very grateful! Best! Andy