Page 1 of 1

[Javascript] Div overflow autoscroll

Posted: Sun Mar 16, 2008 10:13 am
by anto91
hello dudes :mrgreen: i got a problem i have written a chat application using Zend Framework and jQuery

I got the chat container

Code: Select all

 <h2>Chat</h2><p id="warning" style="color:red;">    This page requires javascript to function.<br>    Please enable javascript to join our chat.</p><div id="message-container"></div><div id="message-output">    <input type="text" maxlength="120" size="95" id="message"></div><br><div id="info">    Please rember to not flood the channel.</div> 
And the css

Code: Select all

 
#message-container {
    margin-right:5px;
    border:1px solid #CCC;
    height:400px;
    overflow:auto;
}
 
#message-output {
        margin-right:5px;
    
    padding:5px;
    border-left: 1px solid #CCC;
    border-right: 1px solid #CCC;
    border-bottom: 1px solid #CCC;
}
 
#message-output input {
    border:1px dashed #CCC;
}
 
#message-container p {
    border-bottom:1px dashed #CCC;
    margin:0px;
    padding:5px;
    font-size:15px;
}
 
As you can see that when to many message enter the message-container a scroll is added.
My problem is that i always want the scroll at the bottom of the page.

Re: [Javascript] Div overflow autoscroll

Posted: Mon Mar 17, 2008 10:28 am
by pickle
We have a forum for client side stuff. It's called Client-Side :roll: .

Moving thread there.

Re: [Javascript] Div overflow autoscroll

Posted: Wed Mar 19, 2008 12:19 am
by JAB Creations
To create a vertical-scroll for an overflow element you must either set the height and width or the positioning of the element that has the overflow property.

Re: [Javascript] Div overflow autoscroll

Posted: Sun Mar 23, 2008 8:02 pm
by JellyFish
Try looking into the scrollHeight, scrollWidth, scrollTopand scrollLeftelement properties.