How to use javascript to auto-scroll a scroll panel

Hello,

I found one discussion that relates to this topic, but there was no real solution to this issue.

I have a button "BTN1" on Layer1. When I click BTN1, I show Layer 2. On Layer2 I have a scroll panel with some content (images/text) in it. I also have a trigger on this scroll panel > Execute Javascript when timeline starts. The javascript is:

window.scroll(0, 150);

When I publish the content and run it in a browser on my PC, the contents of the scrolling panel DO NOT automatically scroll when I display Layer2.

  1. Is my js correct?
  2. Is my "Execute Javascript" trigger attached to the right object (e.g. the scrolling panel)?
  3. If I were to use a web object on Layer2 instead of a scrolling panel, how can I trigger "Execute Javascript" when there is no way to reference the web Object on that layer?
10 Replies
david mckisick

You actually can use javascript and link it to a custom object in Storyline via triggers, such as custom buttons. You can't do autoscroll though, which is what I think this thread is about. You are right that many of us requested this feature a long time ago and it was added to the feature request pile and never heard from again.

Avni Vyas

I have been trying this as well. I have one slide with a scrolling panel, when you click on an object it goes to the second slide where I have it execute the same JS.

I'm wondering after looking through the code if window is the right item? (i.e. is it window.scrollTo or something else?)

I tried a few others and it hasn't worked.  If anyone has other ideas please let me know.