Reputation: 29
I have made a website which includes a chatbox. The main text Area has a height of 700px and a scrollbar. Is there a way to limit the scroll height because now the chat is endless if i run the website for a longer period of time. So basicly what i want is that the messages get deleted when they are out of the max scroll height. I hope you can understand my problem. Thanks
<div id="textArea"></div>
<style type="text/css">
#textArea{
width:220px;
height:70%;
position:absolute;
right:0px;
top:38px;
overflow-y:scroll;
overflow-x:hidden;
color:#fefefe;
}
</style>
Upvotes: 1
Views: 1762
Reputation: 71
You'd have to set the overflow-y:
to auto
and, using JavaScript or JQuery, make the messages disappear after they reach a certain height in pixels.
Upvotes: 1