Using JavaScript to hide/toggle the sidebar menu
Dec 03, 2018
By
Gemz Nunn
Hello,
I'm playing around with a couple of the JavaScript examples that we featured in JavaScript Tricks for Articulate Storyline, from eLearning Brothers (https://elearningbrothers.com/blog/javascript-tricks-articulate-storyline-3-360/).
I'm working with the fancy toggle example and trying to set the sidebar to be hidden initially, and when the user clicks the hamburger icon in my custom menu, it toggles the sidebar on. In order for the script to work, the Menu must be switched on in the player, but obviously that means it shows up on the screen. I want the menu to be active, but just hidden at first.
So far my attempts haven't yielded much success. Has anyone had any success in doing something similar?
5 Replies
Update: I figured it out!
I created a new script and added it to the first screen of the Storyline 3 file, executing it when timeline starts. The script sets the opacity and width of the sidebar to the same settings used by the toggle script when hiding it.
Here's the code I used in case anyone else wants to use it:
This is awesome; thanks so much for sharing! Really helped get me unstuck!
Hello Gemz,
Is it possible to toggle Notes using a custom button and JavaScript in Storyline? We see it is possible to toggle audio using this code:
var appState = require("helpers/appState");
appState.onToggleVolume();//mute
Any help MOST appreciated :)
Sincere thanks - Nicole
Is it possible to change the menu potion to top right when we use this script?
hi - when I use this code I can still click on the links, they don't show up but are still active -
this seems to work:
if ( $(".area-secondary").is(':visible')) {
$(".area-secondary").hide();
}
This discussion is closed. You can start a new discussion or contact Articulate Support.