富文本编辑器

因公司需要,让我开发一个论坛。。以前没经验。

论坛首先的有有个编译器

我在网上找到了

KindEditor:

KindEditor是一套开源的HTML可视化编辑器,主要用于让用户在网站上获得所见即所得编辑效果,兼容IE、Firefox、Chrome、Safari、Opera等主流浏览器。 KindEditor使用JavaScript编写,可以无缝的与Java、.NET、PHP、ASP等程序接合。这个是官网上的介绍。

主页:http://www.kindsoft.net/index.php

下载:http://www.kindsoft.net/down.php

示例:http://www.kindsoft.net/demo.php

首先我们导入完整的包

html代码:

<!doctype html>
<html>
<head>
    <meta charset="utf-8" />
    <title>Simple Examples</title>
    <style>
        form {
            margin: 0;
        }
        textarea {
            display: block;
        }
    </style>
    <link rel="stylesheet" href="js/themes/default/default.css" />
    <script charset="utf-8" src="js/kindeditor-min.js"></script>
    <script charset="utf-8" src="js/lang/zh_CN.js"></script>
    <script>
        var editor;
        KindEditor.ready(function(K) {
            editor = K.create('textarea[name="content"]', {
                resizeType : 1,
                allowPreviewEmoticons : false,
                allowImageUpload : false,
                items : [
                    'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
                    'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
                    'insertunorderedlist', '|', 'emoticons', 'image', 'link']
            });
        });
    </script>
</head>
<body>
<h3>发帖</h3>
<form action="www.baidu.com" method="post" style="width: 750px" name="formData">
    <fieldset>
        <legend>快速发帖</legend>
        <input type="text" style="width:400px "/>还可以输入xx字
        <br>
        <br>
        <textarea name="content" style="width:700px;height:200px;visibility:hidden;" id="text">您需要登录后才可以发帖 登录 | 立即注册</textarea>
        <br>
        <button style="submit" >发表帖子</button>
    </fieldset>
</form>
</body>
</html>

  效果展示:

posted @ 2015-06-11 17:39  红色小宇宙  阅读(512)  评论(0编辑  收藏  举报