<script type="text/javascript">
var addH=1;
function addHeight() {
  if (!document.getElementById('comment_content')) return flase;
 var comment = document.getElementById('comment_content');
 var nowH = parseInt(comment.style.height);
 if (nowH < 250) { 
  nowH+=2;
  comment.style.height=nowH+"px";
  addH++;
  if (addH > 25){
   addH=1;
  } else {
  window.setTimeout("addHeight()","10");
  }
 }
}
function minHeight() {
  if (!document.getElementById('comment_content')) return flase;
 var comment = document.getElementById('comment_content');
 var nowH = parseInt(comment.style.height);
 if (nowH > 50) {
  nowH-=2;
  comment.style.height=nowH+"px";
  addH++;
  if (addH > 25){
   addH=1;
  } else {
  window.setTimeout("minHeight()","10");
  }
 }
}
    </script>
</head>
<body>
    <div>
        <input onclick="addHeight()" value="放大" type="button" />
        <input onclick="minHeight()" value="缩小" type="button" />
    </div>
    <textarea id="comment_content" tabindex="1" rows="8" name="comment_content" style="height: 100px">
posted on 2008-11-24 16:53  一只鱼先生  阅读(514)  评论(0)    收藏  举报