Forum Discussion
Jump To Slide via JavaScript Unlocked
Some time ago, several users noticed a variety of additional JavaScript methods embedded in the Review 360 Storyline Player object. These were unavailable in the web or SCORM published versions unless you unlocked a special player mode through file editing. This was unfortunate, as one method I found particularly useful was JumpToSlide(). It allowed you to jump to any project slide by passing the slide ID (viewable in the Slide.Id variable and other locations).
After reviewing a tangentially related ELH post today, I went back and poked at this a bit more. I learned that it's actually very simple to recreate this function in the web and SCORM Storyline players using the function definition and the global DS object.
//Extracted Jump to Slide function from Dark Spider Player
//pass Slide.Id value (string) to this function to jump to the slide
function jumpToSlide(t) {
var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "_frame"
, n = DS.presentation.getFlatSlides().find((function(e) {
return e.id === t
}
));
return null != n ? DS.windowManager.requestSlideForReview(n, e).then((function() {
return {
target: n.absoluteId
}
}
)) : Promise.reject("Slide with id '".concat(t, "' not found"))
}
There are a number of ways you could get the slide IDs for your project, and the ability to jump to any given slide via the ID with JavaScript opens up a lot of possibilities for dynamic navigation through learning modules.
I updated a simple example I had included in another post to demonstrate this. I'll leave it to you to expand upon this and find interesting uses.
Demo: https://360.articulate.com/review/content/0c739698-dd8b-4346-a09a-ab4f73515e9b/review
1 Reply
- jerrygen75Community Member
Thanks for sharing man