<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>textarea</title>
<style type="text/css">
/* Reset style */
* { margin:0; padding:0; word-break:break-all; }
body { background:#FFF; color:#333; font:12px/1.4em Helvetica, Arial, sans-serif; }
input, textarea, select, button { font:12px Helvetica, Arial, sans-serif; }
/* edit style */
#edit { width:300px; margin:50px; }
.edit_caption { width:100%; overflow:hidden; margin-bottom:1px; overflow:hidden; }
.edit_caption span { display:block; float:left; margin:0 1px; padding:4px 10px; background:#DDD; cursor:pointer; }
.edit_caption span:hover { background:#EEE; }
#edit textarea { width:300px; height:80px; margin:0; padding:0; }
</style>
<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 id="edit">
<div class="edit_caption">
<span class="tool_bigger" onclick="addHeight()">bigger</span>
<span class="tool_smaller" onclick="minHeight()">smaller</span>
</div>
<div><textarea id="comment_content" name="comment_content" style="height:100px">

313

被折叠的 条评论
为什么被折叠?



