problem : The IFRAME up and down scroll bar how to default in the bottom, do is the chat tool, the data is much, each refresh appears in the top and bottom scrolling by default, still need to pull down below to see the chat record, there is a way to let it appear in the bottom?
Answer: Directly in the IFRAME to write Window.scrollto (0,9999999) or set div and other containers scrolltop
Copy Code code as follows:
document.getElementById ("x"). scrolltop = document.getElementById ("x"). scrollheight
Window.scrollto (0,9999999)
This is resolved at the bottom, but with new information, the scroll bar will not automatically to the bottom, I hope like QQ Chat window, there are new content, automatic to the bottom, how should we solve it?
Then you should determine what the current generated content is, that is, the top or margin-top is how much, and then set the height of the scroll bar, this can be, each generation will call the height of the scroll bar changes, each get new data, then call Window.scrollto ( 0,9999999) This method, can solve this problem!