码迷,mamicode.com
首页 > Web开发 > 详细

kindeditor HTML 编辑器 ,增加文字水印效果

时间:2015-06-04 13:31:20      阅读:127      评论:0      收藏:0      [点我收藏+]

标签:

<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" %>
<!doctype html>
<html>
<head runat="server">
    <meta charset="utf-8" />
    <title>KindEditor ASP.NET</title>
    <link rel="stylesheet" href="../themes/default/default.css" />
    <link rel="stylesheet" href="../plugins/code/prettify.css" />
    <script charset="utf-8" src="../kindeditor.js"></script>
    <script charset="utf-8" src="../lang/zh_CN.js"></script>
    <script charset="utf-8" src="../plugins/code/prettify.js"></script>
</head>
<body>
    <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
    <form id="example" runat="server">
        <textarea id="content1" cols="100" rows="8" style="width: 700px; height: 200px; visibility: hidden;">
            想说什么呢?记下来吧!!
        </textarea>
        <br />
        <asp:Button ID="Button1" runat="server" Text="提交内容" />
    </form>
</body>
     <script>
         var editor1;
         KindEditor.ready(function (K) {
             editor1 = K.create(#content1, {
                 cssPath: ../plugins/code/prettify.css,
                 uploadJson: ../asp.net/upload_json.ashx,
                 fileManagerJson: ../asp.net/file_manager_json.ashx,
                 allowFileManager: true,
                 afterCreate: function () {
                     var self = this;
                     K.ctrl(document, 13, function () {
                         self.sync();
                         K(form[name=example])[0].submit();
                     });
                     K.ctrl(self.edit.doc, 13, function () {
                         self.sync();
                         K(form[name=example])[0].submit();
                     });
                 },
                 forecolor: gray,
                 afterFocus: function (e) {
                     if (editor1.html() == 想说什么呢?记下来吧!!)
                         editor1.html(‘‘);
                 },
                 afterBlur: function (e) {
                     console.log(editor1.html());
                     if (editor1.html() == <br /> || editor1.html() == ‘‘)
                         editor1.html(想说什么呢?记下来吧!!);
                 }
             });
             prettyPrint();
         });
    </script>
</html>

 

kindeditor HTML 编辑器 ,增加文字水印效果

标签:

原文地址:http://www.cnblogs.com/chand/p/4551432.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!