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 uses html tags within the textarea's body to manage fonts/bold/underline etc. The trick is to supply the tags in the body of the textarea before you create the panel instance.

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 回答