首页 > 其他 > 详细

Fckeditor使用方法

时间:2014-04-26 01:34:33      阅读:508      评论:0      收藏:0      [点我收藏+]

测试Fckeditor版本为:2.6.3

JS代码中各个参数具体作用

<script type="text/javascript">

		var oFCKeditor = new FCKeditor( ‘content‘ ) ;//此参数会作为提交表单时的参数名
		oFCKeditor.BasePath	= "/fckeditor/" ;//一定要指定editor文件夹所在的路径,并且要以‘/‘结尾
		oFCKeditor.Height	= 300 ;//高度
		oFCKeditor.Value	= ‘‘ ;//默认的初始值
		oFCKeditor.ToolbarSet="Basic";//指定工具栏的配置,默认为Default
		//oFCKeditor.Create() ;//在当前位置生成并显示Fckeditor
		oFCKeditor.ReplaceTextarea();//替换指定id或name属性的textarea为Fckeditor
</script>

具体使用方法:

1.将解压后的fckeditor整个文件夹复制到ProjectWebRoot路径下

2.在要使用Fckeditor的页面,导入fckeditor.js(在fckeditor文件夹里)文件

3.根据需要适当修改以下JS代码,复制到要使用Fckeditor的页面即可

<script type="text/javascript">
		$(function(){
			var fck = new FCKeditor("content");//content为要替换的textarea的name属性
			fck.Width = "99%";
			fck.Height = "100%";
			fck.ToolbarSet = "bbs";//指定工具栏的配置,bbs为我自己修改过的
			fck.BasePath = "${pageContext.request.contextPath}/fckeditor/";
			fck.ReplaceTextarea();
		});
</script>

使用自定义的配置文件

1.在fckconfig.js里将FCKConfig.CustomConfigurationsPath = ‘‘修改为:  FCKConfig.CustomConfigurationsPath = FCKConfig.EditorPath + "myconfig.js"  作用:告诉Fckeditor,我有个自定义的配置在该地址下的该文件。

2.在myconfig.js里写想修改的东西,例如:表情,Fckeditor菜单栏的减少等,模版在fckconfig.js里面有,参考着修改即可。没有修改的配置,Fckeditor默认使用自己的默认配置。


Fckeditor使用方法,布布扣,bubuko.com

Fckeditor使用方法

原文:http://blog.csdn.net/v123411739/article/details/24500675

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!