如何更改Nicedit编辑器中显示的文本的Nicedit默认字体大小?

时间:2012-11-18 01:32:10

标签: fonts nicedit

如何更改Nicedit编辑器编辑框中显示的文本的Nicedit默认字体大小?

请在此处查看图片链接: http://4.bp.blogspot.com/-BDOmlcOIcBA/UKbZ-TFLfnI/AAAAAAAACKU/8LRYrZZRio8/s640/toggle0.jpg 编辑框是黄色的rctangle。

我确信编辑font属性的代码是这样的:

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');
  });

任何想法,任何人?

1 个答案:

答案 0 :(得分:0)

nicEdit使用textarea主体中的html标签来管理字体/粗体/下划线等。技巧是在创建面板实例之前在textarea的主体中提供标签。

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');
相关问题