2014-02-21 2 views
0

임 내가 원하는대로 그냥 작동ckeditor -

<textarea class="ckeditor" id="editor5"></textarea> 
<textarea class="ckeditor" id="editor6"></textarea> 
<textarea class="ckeditor" id="editor7"></textarea> 
<textarea class="ckeditor" id="editor8"></textarea> 
<textarea class="ckeditor" id="editor9"></textarea> 

쓰기 텍스트 영역

일부 편집기를 추가하려고 텍스트 영역에 더 많은 편집자를 추가 .. 그러나 메신저는 더 textbo

를 추가하려면이 옵션을 사용하여
message = new Array(); 
jQuery.fn.update_textarea = function(test) { 
    $("#articles_textarea").html(''); 
    for (i=0;i<test;++i) { 
     if (message[i]) { $("#articles_textarea").append('<h2>askda</h2><textarea class="ckeditor" id="editor' + [i] + '"></textarea>'); } 
     else { message[i] = ''; $("#articles_textarea").append('<h2>askda</h2><textarea class="ckeditor" id="editor' + [i] + '"></textarea>'); } 
    } 
} 

그리고 난이 더 추가하면 처음에 광고에만 1 텍스트 영역 다음 CK 편집기 작동 .. 그러나 그것은 작동하지 않습니다 ..

바라건대 사람들은 언제나처럼 대답을 얻었 으면합니다!

바이올린 : http://jsfiddle.net/BpvQ5/

+0

당신은 jsfiddle을 제공 할 수 있습니까? 그럼 우리는 쉬울거야 –

+0

물론! 나는 그것을 고칠 수있다 : – Tommy

+0

편집에서 피들! 하지만 이제는 스크립트로는 전혀 작동하지 않는다는 것을 알게되었습니다. S – Tommy

답변

1

당신이 편집자로이 텍스트 영역을 대체 할 CKEDITOR.replace를 호출 할 필요 dinamically 새로운 텍스트 영역을 만들 때마다 : 새 텍스트 영역을 생성하기 때문에 어쨌든

jQuery.fn.update_textarea = function(test) 
{ 
    $("#articles_textarea").html(''); 
    for (i=0;i<test;++i) 
    {  
     if (message[i]) 
      { 
       $("#articles_textarea").append('<h2>askda</h2><textarea class="ckeditor" id="editor' + i + '"></textarea>'); 
      }else { 
       message[i] = ''; $("#articles_textarea").append('<h2>askda</h2><textarea class="ckeditor" id="editor' + i + '"></textarea>'); 
      } 
      CKEDITOR.replace('editor' + i); 
    } 
} 

, 코드가 실패 이드의 나이 든 사람들과.

http://jsfiddle.net/BpvQ5/4/

+0

정말 고마워요! 정말 좋았어요! :) – Tommy