Scroll to Top of Screen [SOLVED]

Io

How do you make the game scroll to the top of a screen? Preferably something I can enter in 'after entering a room'? Thank you in advance.


To scroll to the top:

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

and to the bottom:

JS.scrollToEnd()

To scroll a particular element to the top of the screen:

msg ("<hr class=\"scrollBreak\" />")
JS.eval("$('html,body').animate({ scrollTop: $('.scrollBreak').last().offset()['top'] }, 'fast');")

Io

Thank you, works like a charm!


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

Support

Forums