<script type="text/javascript" language="JavaScript">
<!--
function countLineBreaks (string) {
var re = /\r\n|\r|\n/g;
var n = 0;
while(re.exec(string)){
n++;
}
return n;
}
function add_rows(){
var oText = document.getElementById('sc_content'); //textarea id
if(document.all) { // IE
while (oText.scrollHeight > oText.clientHeight){
oText.rows++;
oText.scrollTop = 0;
}
while(oText.scrollHeight < oText.clientHeight && oText.rows != 4){ // 기본 rows
oText.rows--;
oText.scrollTop = 0;
}
}else if(oText.rows) { // IE 외
var lineBreaks = countLineBreaks(oText.value);
var rows = parseInt(oText.rows);
if(lineBreaks > rows){
oText.rows = ++rows;
}else if(lineBreaks < rows && oText.rows != 4){ // 기본 rows
oText.rows = --rows;
}else{
while (oText.rows * oText.cols <= oText.value.length) {
oText.rows = ++rows;
}
}
}
}
//-->
</script>
<textarea id="sc_content" name="sc_content" onkeypress="add_rows()" rows=4 cols=80></textarea>
<!--
function countLineBreaks (string) {
var re = /\r\n|\r|\n/g;
var n = 0;
while(re.exec(string)){
n++;
}
return n;
}
function add_rows(){
var oText = document.getElementById('sc_content'); //textarea id
if(document.all) { // IE
while (oText.scrollHeight > oText.clientHeight){
oText.rows++;
oText.scrollTop = 0;
}
while(oText.scrollHeight < oText.clientHeight && oText.rows != 4){ // 기본 rows
oText.rows--;
oText.scrollTop = 0;
}
}else if(oText.rows) { // IE 외
var lineBreaks = countLineBreaks(oText.value);
var rows = parseInt(oText.rows);
if(lineBreaks > rows){
oText.rows = ++rows;
}else if(lineBreaks < rows && oText.rows != 4){ // 기본 rows
oText.rows = --rows;
}else{
while (oText.rows * oText.cols <= oText.value.length) {
oText.rows = ++rows;
}
}
}
}
//-->
</script>
<textarea id="sc_content" name="sc_content" onkeypress="add_rows()" rows=4 cols=80></textarea>
댓글 1개
쉽다zzz
12년 전
감사요~
게시판 목록
팁게시판
디자인과 관련된 유용한 정보를 공유하세요.
질문은 상단의 QA에서 해주시기 바랍니다.
질문은 상단의 QA에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5202 | 12년 전 | 1588 | ||
| 5201 | 12년 전 | 2722 | ||
| 5200 | 12년 전 | 2095 | ||
| 5199 | 12년 전 | 2078 | ||
| 5198 | 12년 전 | 3724 | ||
| 5197 | 12년 전 | 3046 | ||
| 5196 | 12년 전 | 1550 | ||
| 5195 | 12년 전 | 7624 | ||
| 5194 | 12년 전 | 2527 | ||
| 5193 | 12년 전 | 2808 | ||
| 5192 | 12년 전 | 1871 | ||
| 5191 | 12년 전 | 3525 | ||
| 5190 | 12년 전 | 1456 | ||
| 5189 | 12년 전 | 1424 | ||
| 5188 |
프로프리랜서
|
12년 전 | 2068 | |
| 5187 |
프로프리랜서
|
12년 전 | 1379 | |
| 5186 |
프로프리랜서
|
12년 전 | 1822 | |
| 5185 |
프로프리랜서
|
12년 전 | 1873 | |
| 5184 |
프로프리랜서
|
12년 전 | 1326 | |
| 5183 |
프로프리랜서
|
12년 전 | 1553 | |
| 5182 | 12년 전 | 5232 | ||
| 5181 |
프로프리랜서
|
12년 전 | 1641 | |
| 5180 |
프로프리랜서
|
12년 전 | 959 | |
| 5179 |
프로프리랜서
|
12년 전 | 1333 | |
| 5178 |
프로프리랜서
|
12년 전 | 2435 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기