Forum Discussion
Build Custom Search within Storyline using JavaScript
Hi Bridget, thank you for this code, it's great.
Just one question: is there a solution if the same word occurs more than once in the course? I.e., if we can read the word "dog" in the slide 1.2 of the course, but this word is in the slide 2.7 too, how can we jump first to 1.2 and than to 2.7?
Thank you in advance
Gero
Hi Gero,
In JavaScript, the search() method returns the position where the match is first found. You can also use lastIndexOf() to return the position of the last occurrence of a value in a string. So we are kind of limited with the information JavaScript can provide us (initial or end instance). However, I believe you can build this programming by just using JavaScript for the search and building the rest of the programming in Storyline.
Within Storyline, you could program your search to first jump the user to slide 1.2 upon searching for the word "dog", and then add programming on slide 1.2 that jumps the user to slide 2.7 for additional dog information.
Another way you could accomplish this is on your search slide, have a layer appear when searching for the word "dog". On the layer, include text that asks the user to clarify which information about dogs they are looking for and link to either slide 1.2 or 2.7 depending on their layer selection.
Hope this helps!