标签:
之前能看的懂一部分英文,但是总是没有全局观,以至于我之前使用tinymce一直都有一些疑问:那就是为什么我在tinymce初始化中添加了比如字体,字体大小等设置按钮,但是为什么在前
台没有办法现实出来,原来错误的根源是我没有将元素在工具栏或者菜单栏中的设置属性中设置其显示出来,单单只是将该设置放扔到 tinymce.init()中,没有在 toolbar或者menubar中添
加进去。
我的tinymce设置
tinymce.init({ selector: "textarea#elm1" , language : "zh_CN" , width: 600 , height: 300 , plugins: [ "advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker", "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking", "save table contextmenu directionality emoticons template paste textcolor" ] , toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media fullpage | forecolor backcolor emoticons | fontsizeselect | fontselect" , style_formats: [ {title: ‘Bold text‘, inline: ‘b‘}, {title: ‘Red text‘, inline: ‘span‘, styles: {color: ‘#ff0000‘}}, {title: ‘Red header‘, block: ‘h1‘, styles: {color: ‘#ff0000‘}}, {title: ‘Example 1‘, inline: ‘span‘, classes: ‘example1‘}, {title: ‘Example 2‘, inline: ‘span‘, classes: ‘example2‘}, {title: ‘Table styles‘}, {title: ‘Table row 1‘, selector: ‘tr‘, classes: ‘tablerow1‘} ] , fontsize_formats: "8px 10px 12px 14px 18px 24px 36px" , font_formats: "宋体=宋体;" + "微软雅黑=Microsoft YaHei;" + "黑体=黑体;" + "仿宋=仿宋;" + "楷体=楷体;" + "隶书=隶书;" + "幼圆=幼圆;" + "Arial=arial,helvetica,sans-serif;" + "Comic Sans MS=comic sans ms,sans-serif;" + "Courier New=courier new,courier;" + "Tahoma=tahoma,arial,helvetica,sans-serif;" + "Times New Roman=times new roman,times;" + "Verdana=verdana,geneva;" + "Webdings=webdings;" + "Wingdings=wingdings,zapf dingbats" });
Demo下载 : http://files.cnblogs.com/files/xxjudfc/demo.rar
参考说明
谢谢: http://bbs.csdn.net/topics/390845082给我的提示
标签:
原文地址:http://www.cnblogs.com/xxjudfc/p/4312223.html