또한 문제가 있지만 jquery를 사용하여 해결했습니다. 그냥 당신이 제외 할 텍스트 영역에 클래스 ne-except
를 추가하려면이
bkLib.onDomLoaded(function() {
nicEditors.allTextAreas();
jQuery('.ne-except').each(function(){
$parent = jQuery(this).parent();
$parent.children('div').hide();
$parent.children('textarea').show();
});
});
와
bkLib.onDomLoaded(nicEditors.allTextAreas);
을 컨테이너에 텍스트 영역을 넣고 교체합니다.
을 heres 내 바이올린 : http://jsfiddle.net/gozonjoedaimar/9y933f1c/6/
업데이트 : 이 방법을 사용하여 폼 내부의 텍스트 영역은 텍스트 영역의 가치를 게시하지 않는 것을 발견. div.nicEdit-main
내부의 값을 사용합니다. 이 문제를 해결하려면 아래 코드를 사용하십시오.
bkLib.onDomLoaded(function() {
nicEditors.allTextAreas();
jQuery('.ne-except').each(function(){
jQuery(this).prev().prev().hide();
jQuery(this).prev().hide();
jQuery(this).on('keyup',function(){
jQuery(this).prev()
.find('.nicEdit-main')
.html(jQuery(this).val());
});
jQuery(this).show();
});
});
또한 div 요소에 의존하는 이전 솔루션과는 달리 코드가 독립적으로 업데이트되었습니다.
은 "nicEditors.allTextAreas"배열입니까? – Mike