FCKeditor编辑器实战技巧(2)
作者:柠檬园主 来源:3rgb.com 发布时间:2007-10-08 21:13:00
标签:编辑器,fckeditor,技巧
3、外联编辑条(多个编辑域共用一个编辑条)
这个功能是2.3版本才开始提供的,以前版本的FCKeditor要在同一个页面里用多个编辑器的话,得一个个创建,现在有了这个外联功能,就不用那么麻烦了,只需要把工具条放在一个适当的位置,后面就可以无限制的创建编辑域了,如图
要实现这种功能呢,需要先在页面中定义一个工具条的容器:<div id="xToolbar"></div>,然后再根据这个容器的id属性进行设置。
ASP实现代码:
<div id="fckToolBar"></div>
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
with oFCKeditor
.BasePath = fckPath
.Config("ToolbarLocation") = "Out:fckToolBar"
.ToolbarSet = "Basic"
.Width = "100%"
.Height = "200"
.Value = ""
.Create "jcontent"
.Height = "150"
.Value = ""
.Create "jreach"
end with
%>
JAVASCRIPT实现代码:
<div id="xToolbar"></div>
FCKeditor 1:
<script type="text/javascript">
<!--
// Automatically calculates the editor base path based on the _samples directory.
// This is usefull only for these samples. A real application should use something like this:
// oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('_samples')) ;
var oFCKeditor = new FCKeditor( 'FCKeditor_1' ) ;
oFCKeditor.BasePath = sBasePath ;
oFCKeditor.Height = 100 ;
oFCKeditor.Config[ 'ToolbarLocation' ] = 'Out:parent(xToolbar)' ;
oFCKeditor.Value = 'This is some <strong>sample text</strong>. You are using FCKeditor.' ;
oFCKeditor.Create() ;
//-->
</script>
<br />
FCKeditor 2:
<script type="text/javascript">
<!--
oFCKeditor = new FCKeditor( 'FCKeditor_2' ) ;
oFCKeditor.BasePath = sBasePath ;
oFCKeditor.Height = 100 ;
oFCKeditor.Config[ 'ToolbarLocation' ] = 'Out:parent(xToolbar)' ;
oFCKeditor.Value = 'This is some <strong>sample text</strong>. You are using FCKeditor.' ;
oFCKeditor.Create() ;
//-->
</script>
此部分的详细DEMO请参照_samples/html/sample11.html,_samples/html/sample11_frame.html


猜你喜欢
- 写了个简洁的隔行变色代码,支持三种动作变化颜色<!DOCTYPE html PUBLIC "-//W3C//DTD XHTM
- 在正式的生产环境中,我们常常会需要监控服务器的状态,以保证公司整个业务的正常运转,常常我们会用到像nagios、zabbix这类工具进行实时
- 目录前言初始化项目设计代码实现按需加载播放音频录音长按事件运行调试总结前言相信很多养猫的人都很想跟自己的猫进行沟通,当猫咪发出各种不同声音的
- 字典简介Python 中字典和集合也是非常相近的概念,而且从外观看上去,也有那么一丝丝的相似,Python 语言中字典类型是非常灵活的,在实
- ASP结合ADO对数据库方便快捷的访问、结合XML、COM/ActiveX等其它技术 实现服务器多层结构的功能使它在今天还有着顽强的生命力。
- 1.开发环境 vue2.电脑系统 windows10专业版3.在使用vue开发移动端的过程中,我们会因为兼容性而头疼,下面我来分享分享下面v
- 表查询: 合并查询:使用union关键字,可将满足条件的重复行去掉。 select ename,sal,job from emp where
- <'% '************************************************
- 编程语言:python3.9题目编写程序,要求程序能根据用户输入的圆半径数据计算圆的面积(圆的面积公式:S=πr^2),并分别
- sequence 序列sequence(序列)是一组有顺序的元素的集合(严格的说,是对象的集合,但鉴于我们还没有引入“对象”概念,暂时说元素
- 一心想学习算法,很少去真正静下心来去研究,前几天趁着周末去了解了最短路径的资料,用python写了一个最短路径算法。算法是基于带权无向图去寻
- 本文实例讲述了python创建临时文件夹的方法。分享给大家供大家参考。具体实现方法如下:import tempfile, os tempfd
- 题目:如何在python中实现整数的二进制循环移位?概述在python中,可以通过<<以及>>运算符实现二进制的左移
- 1.SYS用户具有DBA权限,并且拥有SYS模式,只能通过SYSDBA登陆数据库。是Oracle数据库中权限最高的帐号SYSTEM具有DBA
- None是一个对象,而NULL是一个类型。Python中没有NULL,只有None,None有自己的特殊类型NoneType。None不等于
- 查看Django版本检查是否安装成功,可以在dos下查看Django版本。1.输入python 2.输入import django3.输入d
- 本文介绍了 setuptools 框架的内容,它是 PEAK 的一个副项目,它提供了比 distutils 更加简单的包管理和发行功能。开始
- 使用下面的命令检查是否安装有MySQL Server[root@localhost etc]# rpm -qa | grep mysql /
- Create PROCEDURE Batch_Delete @TableName nvarchar(100), --表名 @FieldNam
- 本文实例讲述了Python打印scrapy蜘蛛抓取树结构的方法。分享给大家供大家参考。具体如下:通过下面这段代码可以一目了然的知道scrap