Javascript for Scrolling Panel to start at the bottom

Aug 24, 2022

Hi,

I need to reverse a scrolling panel to begin at the bottom and scroll up instead of the current default which begins at the top and scrolls down. Does anyone have custom javascript to accomplish this? Also, does this impact the functionality in an LMS?

Thank you!

Dina

13 Replies
Walt Hamilton

If you group a panel with another object, you can rotate the group. (That’s how to create a side-to-side scroll function, by the way.) If the object is invisible, it doesn’t interfere, and it can take a lot of trial and error to get it exactly right. Set everything else first, and rotate last.

Karen Cote

I need the scroll to start at the bottom as well, but this work-around wouldn't be as useful in my case because it is a software simulation and I don't want to confuse learners by having the scroll bar suddenly appear on the opposite side as they work through the simulation. I will request future development for an option to at least choose start scroll panel at top, middle, or bottom.

Dina Parker

Here is the Javascript that I used:

var myCode = function() {
    $('.scrollarea-area').scrollTop($('.scrollarea-area')[0].scrollHeight);
}
if (window.$ != null) { // If jQuery has already loaded, run myCode.

    myCode();

} else { // Else, load jQuery and then run myCode.

    var jQueryLoader = document.createElement("script");

    jQueryLoader.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js";

    jQueryLoader.onload = function() {

        jQueryLoader.onload = null;

        myCode();

    }

    document.head.appendChild(jQueryLoader);

}

Use the trigger Execute JavaScript and paste this code into the Javascript editor. 

I hope this helps.

Dina

Karen Cote

Thanks for sharing Dina. I just added the trigger, inserted the JavaScript, and published. Unfortunately, it is not working for me, and I don't do any coding so I'm not sure if I would need to modify anything in the code to make it work for me. It was worth a try! I put in a request for a future development to add an option to either start scoll panel at top, middle, or bottom. Or even better, have the scroll bar open to exactly where it is in the Storyline development slide. Maybe one day.....

Eloise LERISSON

Hello Karen,

I figured it out by simply adding this code inside the html file (with notepad++ for example) :

More information here : https://articulate.com/fr-FR/support/article/Storyline-How-to-Reference-the-jQuery-Library

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"> </script>