Scroll To End

Sometimes the text does not scroll to the bottom automatically. The following script used to work in older versions of Quest:

JS.scrollToEnd()

But it doesn't work anymore with the newer versions. Is there another way to do this?


Try this:

JS.eval ("$('html,body').animate({scrollTop: document.body.scrollHeight},'fast');")

Technical: This is probably of no interest to you, but I am posting as a record of what I did. I have had a quick look at this, using timers to print text to fill the screen, and have them occasionally jump to the end by various methods I found on the internet. Resultst vary, depending on how you are playing.

Internet Explorer (v11) just went to the bottom of the page without any prompting at all.

Firefox (v53) and Chrome (v58) scrolled to the bottom with the above code.

In the desktop version of Quest, these will all work:

    JS.eval ("$('#txtCommand').focus();")
    JS.eval ("$('html,body').animate({scrollTop: document.body.scrollHeight},'fast');")
    JS.eval ("window.scrollTo(0,document.body.scrollHeight);")
    JS.eval ("window.scrollTo(0, document.body.scrollHeight || document.documentElement.scrollHeight);")

But not this:

    JS.eval ("$('#txtCommand').scrollIntoView(false);")

Hmm, I tried all (five) of your above lines in a global turn script, one at a time, but couldn't get it to work. I even tried the first four lines all together in a global turn script, but still to no avail.

I am using the desktop editor, and this is a TA (not gamebook). The problem occurs when the player goes from a room with no picture frame to a room with a (big) picture frame.

Thank you for your efforts, though, Pixie. Maybe autoscroll to the bottom could be an option in Quest 5.7? I know you must be very busy with it, plus answering our questions and whatever else you have going on right now : ) Thanks again.


Could you submit it as a bug, and attach the game file?

https://github.com/textadventures/quest/issues

No promises I can fix it, but it has much more chance of getting fixed if I can see the bug in action, as it were.


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

Support

Forums