Forum Discussion
JavaScript Tricks for Articulate Storyline 3/360 show/hide menu
For me in the Modern player, when I use
$('.area-secondary').animate ({
width: 'toggle', opacity: 'toggle'
});
the text in the side menu bar fades away, but the menu bar doesn't actually close/minimize.
You can try this method to toggle the menu in the modern player:
https://www.rabbitoreg.com/examples/p99/#/lessons/a2XRT-5gHOwbWDNMCfBnrbTKF5fmgvqi
Basically, it's using jQuery to trigger a click on the menu button.
- RagesC7 years agoCommunity Member
Thanks for the quick response.
Anyway to toggle the menu (top menu) in the Storyline 3?
- MarkCairns6 years agoCommunity Member
Hi Zsolt,
I've been using the menu open code you provided
$( ".menu-icon-wrapper" ).click();
for a while now. However, I just republished a course and it has stopped working. If I run it in the chrome console it works but not on the button in Storyline. Have you experienced this lately? I'm using the latest version of 360.Thanks!
- PhilMayor6 years agoSuper Hero
jQuery has been removed, and the player has been rewritten so this will not work.
You can preload jquery, you just may need to change the item referenced for it to work. Hopefully Zsolt has a work around.
- MarkCairns6 years agoCommunity Member
Thanks Phil! I found a fix.
Execute this JavaScript on the Slide Master:
function dynamicallyLoadScript(url) {
var script = document.createElement("script");
script.src = url;
document.head.appendChild(script);
}
dynamicallyLoadScript("https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js");
And add this JavaScript trigger to the button:
$( " .menu-icon-wrapper " ).click();