滚动条高度变化jQuery

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="jquery-1.4.2.js"></script>
<script type="text/javascript">
$(function(){
var $comment=$("#comment");
$(".up").click(function(){
if(!$comment.is(":animated"))
{
$comment.animate({scrollTop:"+=50"},400);
}

});

$(".down").click(function(){
if(!$comment.is(":animated"))
{
$comment.animate({scrollTop:"-=50"},400);
}

});

});
</script>
<style>
span{display:inline-block;50px;height:20px;line-height:20px;text-align:center;color:#fff;background:#999;}
textarea{border:1px solid #000;300px;height:100px;}
</style>

</head>

<body>
<form action="">
<div class="message">
<div class="cap_aption">
<span class="up">向上</span>
<span class="down">向下</span>
</div>
<div>
<textarea name="" id="comment" cols="20" rows="8">多行文本框变化多行文本框变化多行文本框变化多行文本框变化多行文本框变化多行文本框变化多行文本框变化多行文本框变化多行文本框变化多行文本框变化行文本框变化多行文本框变化多行文本框变行文本框变化多行文本框变化多行文本框变行文本框变化多行文本框变化多行文本框变行文本框变化多行文本框变化多行文本框变行文本框变化多行文本框变化多行文本框变行文本框变化多行文本框变化多行文本框变</textarea>
</div>
</div>

</form>
</body>
</html>

原文地址:https://www.cnblogs.com/ll-taj/p/5807344.html