eWebEditor首页 >> eWebEditor帮助文档 V15.2 >> 开发手册 >> EWEBEDITOR对象参考 >> EWEBEDITOR 对象属性和方法

3.6.2.8 EWEBEDITOR自动替换事件

EWEBEDITOR默认启用了自动样式类名替换功能,能自动替换网页中的<textarea class="ewebeditor">的文本框。您可以使用EWEBEDITOR属性设置默认名,或关闭此功能。

<head>

<script type="text/javascript">

// 使用自定义的类名,会替换<textarea class="myclassname">

EWEBEDITOR.ReplaceByClassName = "myclassname";

 

// 禁用自动样式类名替换功能

EWEBEDITOR.ReplaceByClassEnabled = false;

 

// 设置编辑器默认配置

EWEBEDITOR.Config = {style:"blue1", width:"600", height:"400"};

</script>

</head>

 

您还可以直接在<textarea>上加上config属性来配置编辑器参数,示例如下

<head>

<script type="text/javascript" src="../ewebeditor.js"></script>

</head>

<body>

<textarea name="content" class="ewebeditor" config="style:coolblue;width:550;height:350"></textarea>

</body>