39 Replies
Jen P

Does anyone know how I can toggle the Notes tab (in the top bar, not the side bar). I've tried Mark Cairns' and Alx Sanchez's approaches, and while they worked for toggling the menu in the sidebar, I had no luck with the tabs in the top bar. The trigger I used was $('.transcript-link').click() . Is there something I'm missing? 

 

Math Notermans

Instead of relying on jQuery it can be easier to use Vanilla Javascript instead...

As this is Allen's code for it:

$( " .menu-icon-wrapper " ).click();
$( " .glossary-tab " ).click();
$( " .view-content " ).click();

removing and changing the jQuery ( $ ) for plain Vanilla Javascript is like this:

document.querySelector("#hamburger > div").click();
document.querySelector("#glossary-tab").click();
document.querySelector("#play-pause > div").click();

If you need other elements in Storyline to show/hide...use the inspector to find its proper selector

Alx Sanchez

Hi James,


Create a slide trigger:

Execute JavaScript
When the timeline reaches time 1s

Where the JavaScript is:
document.querySelector("#hamburger > div").click();
document.querySelector("#glossary-tab").click();
document.querySelector("#play-pause > div").click();

Best,

Alx

Colin Lynas

This is an excellent solution Math. I really appreciate that you kept it simple!

document.querySelector("#hamburger > div").click();

I was wondering if you, or anyone else, knows how to make the default state of the menu and the hamburger invisible. In fact, as I am using my own button to call the menu, the hamburger icon becomes completely reductant so really I am asking....

Is possible to permanently hide the hamburger and have the menu invisible / collapsed as its default state.  

My goal is to have the menu invisible until the end user needs it, then it can appear using a regular button in the course with the code above to toggle the menu when it is needed. 

Thank you in advance for any support you may have.

Math Notermans

To make elements invisible in Storyline360 you can use GSAP code. As GSAP is built into Storyline360 its the easiest way to animate elements. And offcourse simply hide them.

let hamburger = document.querySelector("#hamburger > div");
gsap.set(hamburger, { autoAlpha:0 });

To show the hamburger menu icon again you can add this to a button...

let hamburger = document.querySelector("#hamburger > div");
gsap.to(hamburger, {duration:1.5,autoAlpha:1});

In GSAP set directly sets values and to animates them over time

Remember this only works in Storyline360 as the GSAP Javascript library is built in.

To do the same in Storyline3 you can change the style of the element. Like this.

let hamburger = document.querySelector("#hamburger > div");
hamburger.style.display = 'none';

And to show it again on a button...

let hamburger = document.querySelector("#hamburger > div");
hamburger.style.display = 'block';

Colin Lynas

Just excellent, a truly elegant solution. 

document.querySelector("#hamburger > div"); hamburger.style.display = 'none';

I have it attached to a timeline start action so the end user doesn't see it and they can use the custom button to show/hide the sidebar menu.

----------------------

My final challenge should be simple CSS, I would like to have the sidebar overlay the content rather than resize it. Just working on some CSS swaps. 

Thank you again for the help.