2

Niceditエディタの[編集]ボックスに表示されるテキストのNiceditのデフォルトのフォントサイズを変更するにはどうすればよいですか?

こちらの画像へのリンクを参照してください:http: //4.bp.blogspot.com/-BDOmlcOIcBA/UKbZ-TFLfnI/AAAAAAAACKU/8LRYrZZRio8/s640/toggle0.jpg 編集ボックスは黄色の長方形です。

フォントプロパティを編集するコードは次のようになっていると思います。

area1 = new nicEditor({fullPanel : true}).panelInstance('peterText',{hasPanel : true});

または好き:

area1 = new nicEditor({/*fullPanel : true*/buttonList : ['save','center','right','forecolor','bgcolor','image','fontSize','fontFamily','fontFormat','subscript','superscript','ol','ul','indent','link','unlink','xhtml']
  }).panelInstance('peterText',{hasPanel : true});

または次のようなもの:

  bkLib.onDomLoaded(function() {
        new nicEditor().panelInstance('area1');
        new nicEditor({fullPanel : true}).panelInstance('area2');
        new nicEditor({iconsPath : '../nicEditorIcons.gif'}).panelInstance('area3');
        new nicEditor({buttonList : ['fontSize','bold','italic','underline','strikeThrough','subscript','superscript','html','image']}).panelInstance('area4');
        new nicEditor({maxHeight : 100}).panelInstance('area5');
  });

何かアイデアはありますか?

4

1 に答える 1

0

nicEditは、テキストエリアの本文内のhtmlタグを使用して、フォント/太字/下線などを管理します。トリックは、パネルインスタンスを作成する前に、テキストエリアの本文にタグを指定することです。

var body = document.getElementById('editor_body');
body.innerHTML = "<font face='verdana' color='green' size='6'><div align='left'>Hello!</div></font>";
new nicEditor({iconsPath:'edit/nicEditorIcons.gif'}).panelInstance('editor_body');
于 2013-08-20T20:22:37.153 に答える