KindEditor在jQuery UI Dialog下面的问题,添加自定义插件

[url]http://www.kindsoft.net/ke4/examples/jquery-ui.html[/url]
添加自定义插件 [url]http://kindeditor.net/docs/plugin.html[/url]


在页面的时候使用
KindEditor.ready(function(K) {
editor =KindEditor.create('textarea[name="content"]', {
allowFileManager : true,
resizeType : 1
});
});


在dialog的时候直接create:
editor =KindEditor.create('textarea[name="content"]', {
allowFileManager : true,
resizeType : 1
});



参考代码:
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>With jQuery UI</title>
<style>
body {
font-size: 12px;
}
form {
margin: 0;
}
textarea {
display: block;
}
#J_editorDialog {
display: none;
}
</style>
<link rel="stylesheet" href="../lib/jquery-ui/css/smoothness/jquery-ui-1.9.2.custom.css" />
<link rel="stylesheet" href="../themes/default/default.css" />
<script charset="utf-8" src="../lib/jquery.js"></script>
<script charset="utf-8" src="../lib/jquery-ui/js/jquery-ui-1.9.2.custom.js"></script>
<script charset="utf-8" src="../kindeditor.js"></script>
<script charset="utf-8" src="../lang/zh_CN.js"></script>
<script>
$(function() {
$('#J_openDialog').click(function() {
$('#J_editorDialog').dialog({
title : 'KindEditor',
width : 700,
open : function(event, ui) {
// 打开Dialog后创建编辑器
KindEditor.create('textarea[name="content"]', {
resizeType : 1
});
},
beforeClose : function(event, ui) {
// 关闭Dialog前移除编辑器
KindEditor.remove('textarea[name="content"]');
}
});
});
});
</script>
</head>
<body>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-7116729301372758";
/* 更多演示(728x90) */
google_ad_slot = "5052271949";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<h3>在jQuery UI Dialog里打开编辑器</h3>
<div id="J_editorDialog">
<textarea name="content" style="width:100%;height:200px;"></textarea>
</div>
<button type="button" id="J_openDialog">打开Dialog</button>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值