Forum Discussion
How to Jump to a certain slide using Javascript
Hello! I need to Jump to a certain slide using Javascript, however methods listed back in 2013 for Player object seems to be not working anymore, like player.setSlideIndex(index)
Perhaps, I'm doing something wrong?
var player = GetPlayer();
player.setSlideIndex(1.37)?
- AndrewHanleyCommunity Member
You could just use JS to set a Storyline variable value.
Then a simple "when variable changes..." trigger would immediately jump to whatever slide is called.
You could even put that trigger on the Master slide if you want it to happen on every single slide.
- EsmeraldaBar868Community Member
Thanks!
I have a timer that is only active on certain slides. The timer itself is a SetInterval method.
What I'm trying to do is to JumpToSlide from the function, but I can't find the correct method for Player, which does that.
The idea is to avoid putting the trigger on each slide I need (about 20) or on the Master slide which will affect the whole project in my case. - Nathan_HilliardCommunity Member
Have a look at this for an idea. Note, I've never used this technique for anything, so I can't tell you if it has problems. I just thought you could play around with it.
Use the slider to trigger JavaScript (both on master). You need the slide IDs to specify the jump destination.
https://360.articulate.com/review/content/f2d9996d-2811-45a5-b083-89f78988a743/review