<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에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5877 | 9년 전 | 249 | ||
| 5876 | 9년 전 | 298 | ||
| 5875 | 9년 전 | 279 | ||
| 5874 | 9년 전 | 308 | ||
| 5873 | 9년 전 | 418 | ||
| 5872 | 9년 전 | 308 | ||
| 5871 | 9년 전 | 255 | ||
| 5870 | 9년 전 | 288 | ||
| 5869 | 9년 전 | 401 | ||
| 5868 | 9년 전 | 302 | ||
| 5867 | 9년 전 | 252 | ||
| 5866 | 9년 전 | 258 | ||
| 5865 | 9년 전 | 265 | ||
| 5864 | 9년 전 | 214 | ||
| 5863 | 9년 전 | 213 | ||
| 5862 | 9년 전 | 397 | ||
| 5861 | 9년 전 | 456 | ||
| 5860 | 9년 전 | 246 | ||
| 5859 | 9년 전 | 239 | ||
| 5858 | 9년 전 | 205 | ||
| 5857 | 9년 전 | 231 | ||
| 5856 | 9년 전 | 329 | ||
| 5855 | 9년 전 | 266 | ||
| 5854 | 9년 전 | 184 | ||
| 5853 | 9년 전 | 239 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기