Page immediately scrolls to bottom

I have 0 background in coding and I just want to know how to stop the game from scrolling to the bottom of the page if it opens a page with a large amount of text. I was glancing through the forums and saw someone recommend using this:

JS.eval("scrollToEnd = function () {};")

Could someone please explain to a total novice where and how to insert that code?


Oh, that might've been my topic!

You wanna head into the 'game' object at the top, advanced scripts, User Interface Initialisation Script, code view and just plop it in exactly as written.

It'll appear back in the normal view like 'JavaScript:eval ("scrollToEnd = function () {}")'.

My version of it doesn't have the semicolon at the end, but that's just a separator for adding more to a single line, if I remember correctly.

I can't remember if you have to check a box somewhere to make User Interface Initialisation Script appear, come to think of it...


I can't remember if you have to check a box somewhere to make User Interface Initialisation Script appear

On the "Features" tab of the game object. "Advanced scripts" is hidden by default.


That's the one! Granted, this would probably work elsewhere too, but if you want it activated from the very beginning of your game, this is the first script that'll fire off. If I remember correctly...


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums