Forum Discussion
Trouble with Hotspot and Scrolling Panel
- 18 days ago
Please find the attached .story file. To keep this script reusable, I recommend naming the button or shape at the bottom of your scrolling panel "marker" each time you use it. To get the data-model-id for your object, select the object, right-click it, choose Copy Object ID icon, and paste the value between the double quotes in the script.
I also recommend creating a Storyline T/F variable (e.g., markerInView) and updating it within the script so it can be used as a condition in any Storyline trigger within this slide. Make sure the variable name in the script matches the name of the variable you created in the Storyline Variables panel.
If you don't want the script to enable the player Next button, simply comment out that line using // or remove it entirely. Do the same for line 2, where the Next button is referenced.
If you remove those lines, you'll need to create a Storyline trigger that changes the state of your Next button (either a custom button or the built-in player button) to Normal when the markerInView variable changes to true.
If any of the objects used with the intersection event trigger are not inside the scrolling panel, the trigger simply won't work. I'm sure this could be researched and adjusted with JavaScript to make it work, but if JavaScript is an option, there are better and more efficient solution.
The script I used is simple, easy to understand, and completely reusable, as long as the object at the bottom of the scrolling panel is properly referenced/targeted using its model ID. In my case, the code successfully enables the player's Next button when that object comes into view and can also change any Storyline variable to a different value if needed for something else later on.
Example:
At the bottom of the scrolling panel is a Learn More button (an invisible shape can be added instead). When at least 80% of this button becomes visible within the scrolling panel (the threshold is adjustable in the script), the Storyline variable "markerInView" is set to true and the player's Next button is enabled simultaneously within the same code.
I can upload my Storyline file and the JavaScript herr for anyone who may be interested in using this solution in the future.
That said, if adding an extra click isn't a big deal for your project, I'd recommend Judy's solution. As always, it's an elegant approach, exactly what we've come to expect from JudyNollet​.
- AmyChang-848a0718 days agoCommunity Member
This is cool. Could you please share your file?
- Nedim18 days agoCommunity Member
Please find the attached .story file. To keep this script reusable, I recommend naming the button or shape at the bottom of your scrolling panel "marker" each time you use it. To get the data-model-id for your object, select the object, right-click it, choose Copy Object ID icon, and paste the value between the double quotes in the script.
I also recommend creating a Storyline T/F variable (e.g., markerInView) and updating it within the script so it can be used as a condition in any Storyline trigger within this slide. Make sure the variable name in the script matches the name of the variable you created in the Storyline Variables panel.
If you don't want the script to enable the player Next button, simply comment out that line using // or remove it entirely. Do the same for line 2, where the Next button is referenced.
If you remove those lines, you'll need to create a Storyline trigger that changes the state of your Next button (either a custom button or the built-in player button) to Normal when the markerInView variable changes to true.
Related Content
- 1 year ago
- 10 years ago