如何在tinyMCE中添加字体大小工具栏
how to add font-size toolbar in tinyMCE?
这样我将tinyMCE初始化为一个文本区域。字体,粗体,斜体可以工作,但字体大小选择不工作。
tinymce.init({
selector: "textarea#content",
theme: "modern",
width: 586,
height: 300,
menubar:false,
font_size_classes : "fontSize1, fontSize2, fontSize3, fontSize4, fontSize5, fontSize6",//i used this line for font sizes
content_css: "css/content.css",
toolbar: "sizeselect | bold italic | fontselect | fontsize",//used font size for showing font size toolbar
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'}
],
});**
您需要做的就是将fontsizeselect
添加到您的工具栏配置参数:
toolbar: "sizeselect | bold italic | fontselect | fontsizeselect",
更新:tinymce.init({
fontsize_formats: "8pt 10pt 12pt 14pt 18pt 24pt 36pt"
});
这可能对透视图有用。下面是我的TinyMCE init JS代码,其中包括字体类型和大小的选项。
tinymce.init({
selector: '#articletextarea',
plugins: [
'advlist autolink lists link image charmap preview hr anchor pagebreak',
'searchreplace wordcount visualblocks visualchars code',
'insertdatetime media nonbreaking table contextmenu directionality',
'emoticons template paste textcolor colorpicker textpattern imagetools codesample'
],
toolbar: 'codesample | bold italic sizeselect fontselect fontsizeselect | hr alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | insertfile undo redo | forecolor backcolor emoticons | code',
fontsize_formats: "8pt 10pt 12pt 14pt 18pt 24pt 36pt",
height: "350",
menubar: false
});
theme_modern_font_sizes: "10px,12px,13px,14px,16px,18px,20px",
font_size_style_values: "12px,13px,14px,16px,18px,20px",
toolbar: "insertfile undo redo | fontsizeselect |
我真的很恼火,wordpress似乎是如何努力让人们想要深入研究背景和玩弄代码,甚至是像改变字体这样的基本功能。
幸运的是,我找到了一种方法来启用字体大小菜单,而不需要做任何真正的编码。
Just -
- 使用插件'TinyMCE Advanced'
- 在设置中激活
相关文章:
- 删除CKEditor工具栏按钮,但不删除功能
- Sencha触摸:工具栏无法正常滚动
- 使用网格ID隐藏剑道网格工具栏
- 如何在IE中隐藏菜单栏,工具栏
- 将此事件添加到工具栏
- ExtJS--如何居中对齐两个工具栏按钮
- 在某些URL上显示火狐插件工具栏
- 如何将自定义图标添加到 JqGrid 顶级工具栏按钮
- 文本编辑工具栏解决方案 (js),具有低级自定义
- Ext JS工具栏和痕迹导航示例在JSFiddle中不起作用
- 如何在较新版本的 Free-JQGard 中重置搜索工具栏和搜索过滤器
- 尝试绘制从鼠标位置工具栏中选择的形状 - HTML5 CANVAS
- ExtJS 4-在调整窗口大小时,溢出的工具栏会失去控制器
- 如何在ExtJS 4.2中聚焦工具栏的按钮
- 单击Firefox工具栏按钮中的坐标
- 为什么我的 init() 函数没有运行?(安装 Firefox 扩展时自动添加工具栏按钮,但仅在首次运行时)
- 让jQuery顶部工具栏不那么跳跃
- 你如何在夏季笔记v0.6.0上获取字体大小工具栏
- TinyMCE 4字体工具栏未翻译
- 如何在tinyMCE中添加字体大小工具栏