<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javacript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<link href="perfect-scrollbar-master/src/perfect-scrollbar.css" />
<script type="text/javacript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="perfect-scrollbar-master/src/jquery.mousewheel.js"></script>
<script src="perfect-scrollbar-master/src/perfect-scrollbar.js"></script>
<style>
* {
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; }
textarea {
display: block;
height: 100%;
width: 142px;
border: none;
margin-bottom: 8px;
padding: 0;
resize: none;
overflow-y: hidden;}
div {
width: 150px;
height: 150px;
position: relative;
margin: 0px auto;
padding: 0px;
overflow: hidden;
}
</style>
<script type="text/javascript">
$(function() {
$('div').perfectScrollbar();
$('div').on('keyup','textarea',function(){
$(this).height(0).height( this.scrollHeight );
$('div').scrollTop($(this).outerHeight());
$('div').perfectScrollbar('update');
});
$('div').find( 'textarea' ).keyup();
});
</script>
<title>Unbenanntes Dokument</title>
</head>
<body>
<div>
<textarea>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam sodales urna non odio egestas tempor. Nunc vel vehicula ante. Etiam bibendum iaculis libero, eget molestie nisl pharetra in. In semper consequat est, eu porta velit mollis nec.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam sodales urna non odio egestas tempor. Nunc vel vehicula ante. Etiam bibendum iaculis libero, eget molestie nisl pharetra in. In semper consequat est, eu porta velit mollis nec.>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam sodales urna non odio egestas tempor. Nunc vel vehicula ante. Etiam bibendum iaculis libero, eget molestie nisl pharetra in. In semper consequat est, eu porta velit mollis nec.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam sodales urna non odio egestas tempor. Nunc vel vehicula ante. Etiam bibendum iaculis libero, eget molestie nisl pharetra in. In semper consequat est, eu porta velit mollis nec.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam sodales urna non odio egestas tempor. Nunc vel vehicula ante. Etiam bibendum iaculis libero, eget molestie nisl pharetra in. In semper consequat est, eu porta velit mollis nec.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam sodales urna non odio egestas tempor. Nunc vel vehicula ante. Etiam bibendum iaculis libero, eget molestie nisl pharetra in. In semper consequat est, eu porta velit mollis nec.
</textarea>
</div>
</body>
</html>