kephillips
asked on
auto scroll to bottom of page...
Hi experts.
I'm developing a simple little chat and would like the text to scroll to the bottom of the page. How would I do this???
thanks.
I'm developing a simple little chat and would like the text to scroll to the bottom of the page. How would I do this???
thanks.
I am not exactly sure what your asking for.
If you mean something like this
<html>
<body>
<form name="frmMain">
<input type="text" name="txtChatText" value="">
<input type="button" value="Chat" onclick="this.form.txtChat
<br>
<textarea name="txtChatResults" rows="10" cols="10"></textarea>
</form>
</body>
</html>
I am assuming this is a chat between two users, how are you getting the information from one client to the other?
ASKER
justinbillig,
I'm using mysql as a backend...
I'm using mysql as a backend...
ASKER
arch,
sorry no go..
doesn't do a thing...
sorry no go..
doesn't do a thing...
ASKER
i found what I was looking for guys,
<body onLoad="for (i=0;i<window.screen.avail Height;i++ ) {window.scroll(0,i); }">
thanks anyways!
<body onLoad="for (i=0;i<window.screen.avail
thanks anyways!
Thanks for sharing the answer!
Good luck
Good luck
That does not look right....
If you want the page to scroll to the bottom it is just luck chat window is smaller than the available height and it will stop at for example 600 pixel if that is the size of the window... unless you refresh the window and remove the text that is no longer visible
<body onLoad="window.scrollTo(0, 9999999)">
will also work unless you chat for days
If you want the page to scroll to the bottom it is just luck chat window is smaller than the available height and it will stop at for example 600 pixel if that is the size of the window... unless you refresh the window and remove the text that is no longer visible
<body onLoad="window.scrollTo(0,
will also work unless you chat for days
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
document.body.scrollTop = document.body.scrollHeight
</script>