Forum Discussion
JavaScript Tricks for Articulate Storyline 3/360 show/hide menu
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.
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();- NeilLundin-fcb56 years agoCommunity Member
Thanks Mark. You saved the day!
- AllanBolton6 years agoCommunity Member
Hi Phil,
I thought you might be able to point me in the right direction...
Just wondering/hoping if someone has had any success getting the Hide/Show Sidebar toggle js to work in SL3 V10 released June 6th 2020 as it did in the previous version.
Hide/Show Sidebar toggle works fine i.e., fade/close/minimize using the selector '.area-secondary' when published using SL3 V9 with jQuery bundled
$('.area-secondary').animate ({ width: 'toggle', opacity: 'toggle' });After updating to SL3 V10 with jQuery removed I referenced it using method #1 from - Storyline 360 and Storyline 3: How to Reference the jQuery Library
In SL3 V10 the selector has changed to ID '#sidebar' and is contained in a <section> SL3 V9 used <div>
When using the following code the Hide/Show Sidebar toggle only toggles the opacity but doesn't appear to toggle width i.e., close/minimize the sidebar
$('#sidebar').animate ({ width: 'toggle', opacity: 'toggle' });I've included samples for SL3 V9 and SL3 V10 here for comparison if anyone is interested to have a look.
Thanks
- IrComfar5 years agoCommunity Member
Hi Allan
Did you find a solution?
I have exact same problem