Page 1 of 1

Scrolling: DIV

Posted: Mon Aug 15, 2005 3:29 pm
by raghavan20
How to make a div scroll to down to bottom?
I have the chat window where I want the scroll bar to scroll down as messages come on

Code: Select all

CSS used:
.chatWindow{
	background-color:#CCCCCC;
	color:#000099;
	width:52%;
	height:150px;
	overflow:scroll;
	border: 3px solid #000000;
	padding:10px;
	margin-top:10px;
	margin-left:-5%;
	margin-right:0%;
	float:left;
}

<div id = 'chatWindow' class="chatWindow"></div>

Posted: Mon Aug 15, 2005 3:31 pm
by feyd
viewtopic.php?t=36469

all the way over on page 2.. :P

Posted: Mon Aug 15, 2005 3:53 pm
by raghavan20
I have changed the following but does not seem to work

Code: Select all

CSS:
.chatWindow{
	background-color:#CCCCCC;
	color:#000099;
	width:52%;
	height:150px;
	overflow:auto;----------------------------------->I hv set this as auto from scroll
	border: 3px solid #000000;
	padding:10px;
	margin-top:10px;
	margin-left:-5%;
	margin-right:0%;
	float:left;
}

the function:
	function loadMessages(content){
		document.getElementById("chatWindow").innerHTML = content;
	                document.getElementById("chatWindow").scrollIntoView(false); 
	}

Posted: Mon Aug 15, 2005 4:12 pm
by feyd
if you follow how the thread went in the other one, you'd probably notice an insertion of a new element...