FCKeditor编辑器实战技巧(2)
作者:柠檬园主 来源:3rgb.com 时间:2007-10-08 21:13:00
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
标签:编辑器,fckeditor,技巧
0
投稿
猜你喜欢
Python csv文件的读写操作实例详解
2021-06-07 19:02:41
泛域名设置问题
2008-03-25 10:03:00
python使用tkinter实现透明窗体
2022-09-10 00:58:40
Python的Flask框架中配置多个子域名的方法讲解
2021-03-06 19:46:32
sql2005 存储过程分页示例代码
2024-01-13 03:09:06
python 与c++相互调用实现
2023-01-11 13:20:19
Mac系统下MySql下载MySQL5.7及详细安装图解
2024-01-19 21:36:00
Flask框架web开发之零基础入门
2021-01-03 22:23:02
SQLServer Execpt和not in 性能区别
2024-01-21 23:33:46
如何解决Oracle EBS R12 - 以Excel查看输出格式为“文本”的请求时乱码
2024-01-22 01:17:55
python常见的占位符总结及用法
2023-10-11 10:39:58
Python图像处理库PIL详细使用说明
2021-10-14 17:43:44
PyTorch中torch.matmul()函数常见用法总结
2023-03-28 16:01:31
python数据类型可变不可变知识点总结
2021-10-29 13:26:11
解决python Jupyter不能导入外部包问题
2021-02-02 06:19:03
python 绘制3D图案例分享
2023-12-31 11:54:47
MySQL如何使用使用Xtrabackup进行备份和恢复
2024-01-24 14:45:49
详解使用 pyenv 管理多个版本 python 环境
2023-11-01 03:40:05
Python3enumrate和range对比及示例详解
2021-02-05 02:11:47
mysql中文排序注意事项与实现方法
2024-01-15 17:18:55