jQuery插件Lightweight Rich Text Editor轻量级Html在线编辑器

轻量级的东西往往最受人欢迎,Lightweight Rich Text Editor这个基于jQuery轻量级编辑器,使用简单,但功能强大,所谓麻雀虽小五脏俱全,扩展性强,支持文件和图片上传功能 等,Lightweight Rich Text Editor编辑器效果图如下:
lightweight-rich-text-editor
一,使用说明
1,jQuery1.2.6 或 1.3 文件

2,Lightweight Rich Text Editor js库文件

二,自定义编辑器CSS样式,Lightweight Rich Text Editor提供默认CSS样式,具体可看看下载包目录中的jquery.rte.css文件。

三,使用实例
(1)包含文件部分

  1. <script type="text/javascript" src="jquery.js"></script>
  2. <script type="text/javascript" src="jquery.rte.js"></script>
  3. <script type="text/javascript" src="jquery.rte.tb.js"></script>
  4. <script type="text/javascript" src="jquery.ocupload-1.1.4.js"></script>

(2)HTML部分

  1. <textarea name="form[info1]" cols="100" rows="10"  id="info1" class="rte" method="post" action="#">
  2. <p>必优博客 www.biuuu.com</p>
  3. </textarea>

(3)javascript调用部分

  1. <script type="text/javascript">
  2. $('.rte').rte({
  3. css: 'default.css',
  4. width: '50%',
  5. height: '100px',
  6. controls_rte: rte_toolbar,
  7. controls_html: html_toolbar
  8. });
  9. </script>

使用非常简单,代码分析如下:
1,css 定义CSS样式文件,如上:default.css
2,width 定义编辑器宽度,值或百分比
3,height 定义编辑高度,值或百分比
4,controls_rte 定义编辑器使用控制条,如bold,italic,strikeThorugh等工具
5,controls_html 定义编辑器使用HTML控制条,如word,clear和s1工具
其中controls_rte和controls_html两个工具定义在jquery.rte.tb.js文件中

具体使用大家可看看Lightweight Rich Text Editor实例,使用非常简单,值得推荐。

查看Lightweight Rich Text Editor功能接口
下载Lightweight Rich Text Editor编辑器