1 Star 0 Fork 296

清风/ueditor-plus

forked from ModStartLib/ueditor-plus 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
multiEditorWithOneInstance.html 2.49 KB
一键复制 编辑 原始数据 按行查看 历史
MZ 提交于 2023-11-01 11:03 +08:00 . build
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title></title>
<script type="text/javascript" charset="utf-8" src="../ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="editor_api.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.3.min.js"></script>
<style>
table {
margin-bottom: 10px;
border-collapse: collapse;
display: table;
border: 1px dashed #ddd
}
#test td {
padding: 5px;
border: 1px solid #DDD;
}
</style>
<script>var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?f84f35a44b5cc5c0b10c3fabdf0f322b";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();</script>
<link rel="stylesheet" href="./style.css"/>
</head>
<body class="demo-editor-page wide">
<div>
<h1>UEditor多编辑区域一个编辑器实例</h1>
<table id="test">
<tr>
<td width="100">
编辑区域一
</td>
<td class="content" id="content1">
<script id="editor1" type="text/plain" style="width:1024px;height:200px;">内容1</script>
</td>
</tr>
<tr>
<td>
编辑区域二
</td>
<td class="content" id="content2">内容2</td>
</tr>
<tr>
<td>
编辑区域三
</td>
<td class="content" id="content3">内容3</td>
</tr>
</table>
<script type="text/javascript">
var ue = UE.getEditor('editor1');
ue.ready(function () {
//阻止工具栏的点击向上冒泡
$(this.container).click(function (e) {
e.stopPropagation()
})
});
$('.content').click(function (e) {
var $target = $(this);
var content = $target.html();
var currentParnet = ue.container.parentNode.parentNode;
var currentContent = ue.getContent();
$target.html('');
$target.append(ue.container.parentNode);
ue.reset();
setTimeout(function () {
ue.setContent(content);
}, 200)
$(currentParnet).html(currentContent);
})
</script>
</div>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/pdtyf/ueditor-plus.git
git@gitee.com:pdtyf/ueditor-plus.git
pdtyf
ueditor-plus
ueditor-plus
master

搜索帮助