한국어
<!-- http://www.downcodes.com/js --> <!-- bbs http://www.downcodes.com/bbs--> <!-- 完整的HTML代码 --> <html > <head> <style type="text/css"> .progress{ 너비: 1px; 높이: 14px; 색상: 흰색; 글꼴 크기: 12px; 오버플로: 숨김; 배경색: 네이비; 왼쪽 패딩: 5px; } </style> <script type="text/JavaScript"> function textCounter(field,counter,maxlimit,linecounter) { // 텍스트 너비// var fieldWidth =parseInt(field.offsetWidth); var charcnt = field.value.length; // 추가 텍스트 자르기 if (charcnt > maxlimit) { field.value = field.value.substring(0, maxlimit); } else { // 진행률 표시줄 백분율 var Percent =parseInt(100 - (( maxlimit - charcnt) * 100)/maxlimit) ; document.getElementById(counter).style.width =parseInt((fieldWidth*percentage)/100)+"px"; document.getElementById(counter).innerHTML="Limit: "+percentage+"%" // CCFFF의 스타일 색상 보정 -> CC0000 setcolor(document.getElementById(counter),percentage,"Background-color"); } } function setcolor(obj,percentage,prop){ obj.style[prop] = "rgb(80%,"+(100-퍼센트)+"%,"+(100-퍼센트)+"%)"; } </script> </head> <body> <form> <textarearows="5" cols="40" name="maxcharfield" id="maxcharfield" onKeyDown="textCounter(this,'progressbar1',20) " onKeyUp="textCounter(this,'progressbar1',20)" onFocus="textCounter(this,'progressbar1',20)" ></textarea><br /> <div id="progressbar1" class="progress" ></div> <script>textCounter(document.getElementById("maxcharfield"),"progressbar1",20)</script> </form> </body> </html> <br><br><br> <p><글꼴 색상=빨간색>//网站:http://www.downcodes.com</font></p>