这是一款经过ace主题切换过的编辑器,比起官方的编辑器要好看的多,主要缺点是引入文件有点多,若放在管理员后台无所谓了
0、请不要问“在不在”之类的问题,有问题直接问!1、学生或暂时没有工作的童鞋,整站资源免费下载!2、¥9.9充值终身VIP会员,加我微信,826096331 拉你进VIP群学习!3、程序员加油,技术改变世界。在线 充值
HTML
首先我们在页面上放置#editor1,用来生成编辑器
<div class="wysiwyg-editor" id="editor1"></div>
调用ace编辑器:
$('#editor1').ace_wysiwyg({
toolbar: ['font', null, 'fontSize', null, {
name: 'bold',
className: 'btn-info'
},
{
name: 'italic',
className: 'btn-info'
},
{
name: 'strikethrough',
className: 'btn-info'
},
{
name: 'underline',
className: 'btn-info'
},
null, {
name: 'insertunorderedlist',
className: 'btn-success'
},
{
name: 'insertorderedlist',
className: 'btn-success'
},
{
name: 'outdent',
className: 'btn-purple'
},
{
name: 'indent',
className: 'btn-purple'
},
null, {
name: 'justifyleft',
className: 'btn-primary'
},
{
name: 'justifycenter',
className: 'btn-primary'
},
{
name: 'justifyright',
className: 'btn-primary'
},
{
name: 'justifyfull',
className: 'btn-inverse'
},
null, {
name: 'createLink',
className: 'btn-pink'
},
{
name: 'unlink',
className: 'btn-pink'
},
null, {
name: 'insertImage',
className: 'btn-success'
},
null, 'foreColor', null, {
name: 'undo',
className: 'btn-grey'
},
{
name: 'redo',
className: 'btn-grey'
}],
'wysiwyg': {
fileUploadError: showErrorAlert
}
}).prev().addClass('wysiwyg-style2');
默认效果
$('#editor1').ace_wysiwyg();
友情提示:垃圾评论一律封号 加我微信:826096331拉你进VIP群学习群