如何在一个页面添加多个不同的kindeditor编辑器
kindeditor官方下载地址:http://kindeditor.net/down.php
(入门必看)kindeditor官方文档:http://kindeditor.net/doc.php
(入门必看)Kindeditor编辑器初始化参数文档:http://kindeditor.net/docs/option.html
或许我们一个页面有需要用到多个文本编辑器的情况,那我们该怎么办呢? 本人查阅了很多资料最后终于找到一种方法,可以通过自定义编辑器的工具栏items属性,来实现:
直接上JS了:
<span class="lspan"><font color="red">*</font>商品信息:</span><%--<span class="lspan">
<input id="txtProductInfo" placeholder="请输入商品信息" value="<%=product.ProductInfo %>"
name="txtProductInfo" type="text" maxlength="25" style="width: 444px" /></span>--%>
<script type="text/javascript">
KindEditor.ready(function (K) {
editor = K.create('#txtProductInfo', {
cssPath: '../kindeditorx/plugins/code/prettify.css',
uploadJson: '../kindeditorx/asp.net/upload_json.ashx',
fileManagerJson: '../kindeditorx/asp.net/file_manager_json.ashx',
minWidth: 444,
minHeight: 200,
maxWidth: 444,
resizeType: 1,
filterMode: false,
allowFileManager: true,
items: ['source', '|', 'undo', 'redo', '|', 'justifyleft', 'justifycenter', 'justifyright',
'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript', 'superscript',
'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '|', 'forecolor','hilitecolor','bold','italic'
,'underline','strikethrough','lineheight','removeformat'
]
});
});
</script>
<textarea id="txtProductInfo" rows="5" cols="" style="width: 400px;"><%=product.ProductInfo %></textarea>
重点:
下面这些自定义显示工具是关键,其他的编辑器只需要修改items属性就可以了。
items: ['source', '|', 'undo', 'redo', '|', 'justifyleft', 'justifycenter', 'justifyright',
'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript', 'superscript',
'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '|', 'forecolor','hilitecolor','bold','italic'
,'underline','strikethrough','lineheight','removeformat'
]
});
如下效果图:
关于items参数的解释如下:
source | HTML代码 |
preview | 预览 |
undo | 后退 |
redo | 前进 |
cut | 剪切 |
copy | 复制 |
paste | 粘贴 |
plainpaste | 粘贴为无格式文本 |
wordpaste | 从Word粘贴 |
selectall | 全选 |
justifyleft | 左对齐 |
justifycenter | 居中 |
justifyright | 右对齐 |
justifyfull | 两端对齐 |
insertorderedlist | 编号 |
insertunorderedlist | 项目符号 |
indent | 增加缩进 |
outdent | 减少缩进 |
subscript | 下标 |
superscript | 上标 |
formatblock | 段落 |
fontname | 字体 |
fontsize | 文字大小 |
forecolor | 文字颜色 |
hilitecolor | 文字背景 |
bold | 粗体 |
italic | 斜体 |
underline | 下划线 |
strikethrough | 删除线 |
removeformat | 删除格式 |
image | 图片 |
flash | Flash |
media | 视音频 |
table | 表格 |
hr | 插入横线 |
emoticons | 插入表情 |
link | 超级链接 |
unlink | 取消超级链接 |
fullscreen | 全屏显示 |
about | 关于 |
打印 | |
code | 插入程序代码 |
map | Google地图 |
baidumap | 百度地图 |
lineheight | 行距 |
clearhtml | 清理HTML代码 |
pagebreak | 插入分页符 |
quickformat | 一键排版 |
insertfile | 插入文件 |
template | 插入模板 |
anchor | 插入锚点 |
如何在一个页面添加多个不同的kindeditor编辑器的更多相关文章
- 基于bshare分享平台,在一个页面上实现多个不同内容的web分享
<!--引入bshare SDK--><script type="text/javascript" charset="utf-8" src=& ...
- Laravel 5.2分页--怎么在一个页面实现两个以上的列表分页,互不影响?
今天就碰到这样的一个问题?想在一个页面里面放两个列表,并且两个列表都可以进行分页. 但是,laravel提供的分页方法很方便,可是两个以上就出问题了,当我点其中一个分页的链接时候,页面上其余的分页跟着 ...
- JavaWeb页面添加隐藏版权信息
JavaWeb页面添加隐藏版权信息. 首先,我推荐一个值得玩味的版权站点,有兴趣的朋友能够去看上一看.Nazo Level 1,这个demo中我能发掘到有5个步骤,你看你能发现几层? 接下来.我来介绍 ...
- 如何在一个页面上让多个jQuery
如何在一个页面上让多个jQuery共存呢?比如jquery-1.5和jquery-1.11. 你可能会问,为什么需要在一个页面上让多个jQuery共存?直接引用最新版本的jQuery不行吗? 答案是, ...
- 如何在MVC_WebAPI项目中的APIController帮助页面添加Web测试工具测试
本文转载自:http://www.cnblogs.com/pmars/p/3673811.html 先看效果图: 以下是原文: 如何在帮助页面添加测试工具 上一篇我在ASP.NET里面添加了一个Hel ...
- 如何给你的ASP.NET页面添加HelpPage
如何给你的ASP.NET页面添加HelpPage 最近写了一些webAPI,所以需要搞一套API的帮助文档,google了一下,发现这是可以自动生成的,以下就是如何自动生成HelpPage的说明. 参 ...
- Magento给新产品页面添加分页
本文介绍如何让magento创建一个带分页功能的新到产品页面,方便我们在首页或者其它CMS Page调用和展示新到产品. 在Magento我们经常有的做法是建立一个可以调用新产品的block,然后通过 ...
- 如何给magento的产品页面添加返回按钮
如何给magento的产品页面添加返回按钮,最模板提供教程 第一步: 打开 E:\xampp\htdocs\magento\skin\frontend\default\bluescale\css\st ...
- sharepoint 2010 页面添加footer方法 custom footer for sharepoint 2010 master page
转:http://blog.csdn.net/chenxinxian/article/details/8720893 在sharepoint 2010的页面中,我们发现,没有页尾,如果我们需要给页面添 ...
随机推荐
- 掌握javascript中的最基础数据结构-----数组
这是一篇<数据结构与算法javascript描述>的读书笔记.主要梳理了关于数组的知识.部分内容及源码来自原作. 书中第一章介绍了如何配置javascript运行环境:javascript ...
- php批量删除
php批量删除可以实现多条或者全部数据一起删除 新建php文件 显示数据库中内容: <table width="100%" border="1" cell ...
- input type='file'上传控件假样式
采用bootstrap框架样式 <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> &l ...
- HotApp小程序服务范围资质查询器
微信小程序提交审核需要选择资质服务范围,如果服务范围不对,审核会不通过, 开发小程序之前,最好先查询所开发小程序的资质范围,否则无法通过微信审核. 小程序的资质范围查询地址,数据同步微信官方 ht ...
- Android开发学习——画横线竖线
画横线/竖线 竖线 <View android:layout_width="1dp" android:layout_height="match_parent&quo ...
- 基于SOA架构的TDD测试驱动开发模式
以需求用例为基,Case&Coding两条线并行,服务(M)&消费(VC)分离,单元.接口.功能.集成四层质量管理,自动化集成.测试.交付全程支持. 3个大阶段(需求分析阶段.研发准备 ...
- [原创]ubuntu16.04LTS使用细节
如何给自己安装的应用创建桌面图标 拿php开发神器phpstorm为例,找到可执行文件所在路径. 这里是/home/haive/PhpStorm/bin/phpstorm.sh 打开dash,搜索&q ...
- v14.0\AspNet\Microsoft.Web.AspNet.Props 找不到
错误 E:\Github\AutoMapper\src\AutoMapper\AutoMapper.CoreCLR.kproj : error : 未找到导入的项目"C:\Program ...
- weinre- 调试移动端页面
相信很多前端的小伙伴一定会遇到一个问题, 比如我编写完一个页面,某个地方需要进行调整细节或者是哪个地方怎么调整都不对,在pc端还好,有google,firefox之类可以调节页面的工具,虽说这些工具有 ...
- ASP.NET 5 改名 ASP.NET Core 1.0
今天,Scott Hanselman在其博客上宣布<ASP.NET 5 is dead - Introducing ASP.NET Core 1.0 and .NET Core 1.0>, ...