Forum Discussion
Jump to specific point in a scrolling panel
A 'boxthree' is a variable name. This variable was not created in Storyline. You can rename it to something more meaningful to you. In summary, this JavaScript code selects all HTML elements that have the data-acc-test (I think it should be data-acc-text) attribute containing the word 'msgthree' and stores them in the variable 'boxthree'. You can then use this variable to access and manipulate these selected elements in your JavaScript code. Now, in order for this code to work, you need to make sure that msgthree is typed in Accessibility text box in Storyline. You can type what ever you like but ensure that this value is updated in the code above as well.
For example, my code could look like this:
var myScrollObjects = document.querySelectorAll('[data-acc-test~="scrollobj"]');
myScrollObjects[0].scrollIntoView({block: "end", inline: "nearest"});
If you have two objects with the same data-acc-text attribute but you only want to move the second one, you would execute the following line:
myScrollObjects[1].scrollIntoView({block: "end", inline: "nearest"});
// in JavaScript the indexing starts from 0, not 1
Related Content
- 8 months ago
- 5 months ago