cheditor 글쓰기 박스 자동으로 늘어 나기 정보
cheditor 글쓰기 박스 자동으로 늘어 나기본문
에디터에 글을 쓰면 에디터가 자동을 늘어나는 기능
글이 삭제하면 줄어든다
cheditor 에 cheditor.js 에 보면
2539 라인쯤에
doOnKeyUp : function () {
this.config.keyUpCount++;
},
이 있다
doOnKeyUp : function () {
parent.checker();
this.config.keyUpCount++;
},
위와 같이 parent.checker();
를 추가 한다
write.skin 에 아래를 추가한다
<script type="text/javascript">
//에디터 줄늘어 나는 함수
//------------------------------------
function checker()
{
var height = 0 ;
jQuery("#wr_content_td iframe").contents().find("body > div").each(function (){
height += jQuery(this).height();
});
jQuery("#wr_content_td iframe").contents().find("body > p").each(function (){
height += jQuery(this).height();
});
if(height > 210)
{
jQuery("#wr_content_td iframe").height(height+40);
}
else
{
jQuery("#wr_content_td iframe").height(250);
}
}
//------------------------------------
//에디터 줄늘어 나는 함수 완료
</script>
글이 삭제하면 줄어든다
cheditor 에 cheditor.js 에 보면
2539 라인쯤에
doOnKeyUp : function () {
this.config.keyUpCount++;
},
이 있다
doOnKeyUp : function () {
parent.checker();
this.config.keyUpCount++;
},
위와 같이 parent.checker();
를 추가 한다
write.skin 에 아래를 추가한다
<script type="text/javascript">
//에디터 줄늘어 나는 함수
//------------------------------------
function checker()
{
var height = 0 ;
jQuery("#wr_content_td iframe").contents().find("body > div").each(function (){
height += jQuery(this).height();
});
jQuery("#wr_content_td iframe").contents().find("body > p").each(function (){
height += jQuery(this).height();
});
if(height > 210)
{
jQuery("#wr_content_td iframe").height(height+40);
}
else
{
jQuery("#wr_content_td iframe").height(250);
}
}
//------------------------------------
//에디터 줄늘어 나는 함수 완료
</script>
추천
1
1
댓글 1개
감사합니다.