Scrolling: DIV

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Scrolling: DIV

Post 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>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

viewtopic.php?t=36469

all the way over on page 2.. :P
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post 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); 
	}
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

if you follow how the thread went in the other one, you'd probably notice an insertion of a new element...
Post Reply