When it comes to eLearning content development, creating a smooth and personalized user experience is key. One way to enhance engagement is by customizing how menus appear in your course. In this tutorial, we’ll walk through how to activate custom menus only after users visit specific slides using JavaScript in Storyline 360.
Click Preview to watch how to Activate Custom Menus after Visiting Slides in Storyline 360 Using JavaScript.
This approach is ideal for custom eLearning development, where navigation should reflect learner progress rather than a static menu.
Why Custom Menus Matter in eLearning Development
In eLearning training, learners often benefit from guided navigation rather than full access to every module at once. By using JavaScript to control menu visibility, you can:
Using custom menus that activate only after visiting slides offers several advantages:
1. Controlled Navigation: Learners progress step by step through the content.
2. Improved Engagement: Unlocking content as learners move forward maintains curiosity and focus.
3. Adaptive Learning Paths: Menus reflect individual learner progress in real time.
4. Professional User Experience: Structured menus give courses a more polished, corporate feel.
Whether you’re working on a corporate training program or a learning management system (LMS) integration, this technique gives you greater control over the learning experience.
Detailed Step-by-Step Guide: Implementing Custom Menus in Storyline 360
Below is a comprehensive breakdown of how to set up dynamic menus in Articulate Storyline 360 using variables and JavaScript.
1. Open Your Project
Start by opening your course in Storyline 360. Navigate to the slide or scene where you want the menu behavior to begin. This is often your main menu slide or a navigation hub.
2. Create a Tracking Variable
To control menu visibility, you need a Text variable that tracks which scene or slide the learner has visited.
- Go to the Variables panel in Storyline.
- Click the (+) icon to create a new variable.
- Set the variable type to Text.
- Name it something descriptive, such as chosenScene.
- Leave the default value blank.
This variable will dynamically update as learners click different buttons or visit different scenes.
3. Add Triggers to Update the Variable
For each menu button or navigation element, create a trigger to update the variable value. This allows the course to “remember” which scene the learner has accessed.
Example setup:
Button 1:
- Action: Adjust Variable
- Variable: chosenScene
- Value: “Module 1“
- When: User clicks Button 1
Repeat this process for each button 2 and 3 that represents a section of your course. This step is essential for eLearning training modules that need to control progression across multiple topics.
4. Use the Slide Master to Insert JavaScript
To ensure the menu behavior works consistently across slides, insert your JavaScript code in the Slide Master rather than on individual slides.
- Go to the View tab and select Slide Master.
- Choose the layout that applies to your navigation menu (usually the main layout).
- Create a Trigger:
- Action: Execute JavaScript
- When: Timeline starts on this slide.
- Click the JavaScript link to open the editor.
- Paste your JavaScript code (see example below).
function updateMenu() {
// Always keep these scenes visible
const allowedScenes = [“Scene 1”];
// Get user’s branch selection from Storyline variable
const player = GetPlayer();
const chosenScene = player.GetVar(“chosenScene”);
if (chosenScene) allowedScenes.push(chosenScene);
// Select all built-in menu items (each scene link)
const menuItems = document.querySelectorAll(“.menu-scene, .is-scene”);
menuItems.forEach(menu => {
// Works for both Storyline player menu and custom menus
const title = menu.getAttribute(“data-slide-title”) || menu.textContent.trim();
// Show only allowed scenes
const isAllowed = allowedScenes.includes(title);
if (menu.parentElement) {
menu.parentElement.style.display = isAllowed ? “” : “none”;
} else {
menu.style.display = isAllowed ? “” : “none”;
}
});
}
// Run once at load
updateMenu();
// Optional: Re-run if variable changes dynamically
if (window.GetPlayer) {
const player = GetPlayer();
const originalSetVar = player.SetVar;
player.SetVar = function (varName, value) {
originalSetVar.call(player, varName, value);
if (varName === “chosenScene”) updateMenu();
};
}return `#${randColor.toUpperCase()}`
}
- Replace any placeholder text with your main menu title or variable references.
- Click OK to save, then close the Slide Master.
5. Preview and Test Thoroughly
Click Preview to test your course. Interact with each button to ensure that:
- The variable updates correctly when a button is clicked.
- The JavaScript runs when the slide starts.
- The correct menu item becomes visible for each visited scene.
- Menu behavior persists as learners navigate between scenes.
Testing is crucial in eLearning development, especially when combining triggers and JavaScript. Be sure to test in multiple browsers and in your learning management system to confirm consistent behavior.
Additional Tips for Professional eLearning Courses
1. Use Consistent Naming Conventions: Keep variable and menu IDs clean and descriptive.
2. Combine with Completion Tracking: You can integrate this with course completion rules in your LMS.
3. Leverage Slide Masters for Efficiency: This ensures the script runs consistently without having to add it to every slide.
4. Plan Navigation Early: In custom eLearning development, define your menu logic during the design phase to avoid rework later.
Looking for a Learning Management System (LMS) Solution?
We offer Learning Management System (LMS) solutions tailored to your organization’s unique training, compliance, and performance management goals.
Whether you’re a corporate organization, educational institution, or non-profit, we’re here to help you deliver engaging, scalable, and measurable learning experiences.
Key Benefits for eLearning Projects
Integrating JavaScript for custom menu behavior offers clear benefits for organizations investing in eLearning services:
1. Better Learner Control: Ensures structured progression and compliance.
2. Scalability: Works seamlessly in large, multi-scene courses.
3. Improved Engagement: Learners see a tailored menu based on their journey.
4. Professional Look & Feel: Elevates the overall design quality of your eLearning training modules.
Conclusion
Activating custom menus after visiting slides in Storyline 360 using JavaScript is a powerful, flexible technique that significantly enhances learner experience. By combining variables, triggers, and JavaScript, you can control navigation, reinforce learning paths, and create a polished interface that reflects best practices in eLearning content development.
Whether you are working on a small internal course or a large-scale program integrated with a learning management system, this approach aligns perfectly with modern custom eLearning development standards. It’s a practical way to deliver structured, engaging, and professional courses that learners will find intuitive and effective.
Frequently Asked Questions (FAQs)
Q1. What is Storyline 360 used for in eLearning development?
A. Storyline 360 is a leading authoring tool used in eLearning content development to create interactive courses, quizzes, and assessments. It allows instructional designers to build SCORM/xAPI-compliant modules that integrate seamlessly with any learning management system.
Q2. Why is using JavaScript in Storyline 360 beneficial for eLearning training?
A. JavaScript extends Storyline’s functionality, enabling developers to implement dynamic features like conditional menus, progress-based interactions, and adaptive navigation. This is especially useful in corporate eLearning training, where structured flow is essential.
Q3. What type of courses benefit most from custom menu activation?
A. Custom menu activation works best for structured eLearning training programs, compliance courses, onboarding modules, and certification pathways where learners need to complete content in a specific order.
Q4. Why should I use JavaScript for menu customization in Storyline 360?
A. While Storyline’s built-in triggers are powerful, JavaScript provides more flexibility for controlling menu visibility and behavior. It allows for dynamic, learner-specific navigation, making it ideal for custom eLearning development and LMS-based deployments.
Q5. Where should I add the JavaScript code in Storyline 360?
A. The best place to insert the JavaScript is in the Slide Master, set to run when the timeline starts. This ensures the menu customization applies consistently across multiple slides, rather than adding the code individually to each slide.