<textarea onkeyup="this.style.height = 'auto'; this.style.height = this.scrollHeight + 'px'"></textarea>
$(window).resize(function(){
$('body').width(Math.min(800, parseInt(($(window).width() - 800) / 50) * 50));
});
.content
{
position: absolute;
top: 100px;
left: 0;
right: 0;
bottom: 0;
background-color: #8cc;
overflow: auto;
}
$(document).ready(function(){
$(window).scroll(function(){
var header = $('.header').detach();
var scrollTop = $(window).scrollTop();
$('.container p').each(function(){
if ($(this).offset().top > scrollTop)
{
$(header).insertBefore(this);
header = null;
return false;
}
});
if (header)
{
$('.container').append(header);
}
});
});