Forum Discussion
JavaScript Tricks for Articulate Storyline 3/360 show/hide menu
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!
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!
- JamesMcCarthy-e5 years agoCommunity Member
Is it possible to do this when the timeline starts instead of when a button is clicked?
- AlxSanchez-2a8b5 years agoCommunity Member
Hi James,
Create a slide trigger:Execute JavaScript
When the timeline reaches time 1sWhere the JavaScript is:
document.querySelector("#hamburger > div").click();document.querySelector("#glossary-tab").click();document.querySelector("#play-pause > div").click();Best,
Alx
- Sagar_Mavale3 years agoCommunity Member
Hi Mark,
Many thanks to post this solution.
- 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
- GregoryNabong5 years agoCommunity Member
Hi, Allan.
Were you able to completely hide the sidebar? I'm having the exact same issue.