首页 新闻 会员 周边

自己不会。只好来这里求了。合并二个JS

0
悬赏园豆:5 [已解决问题] 解决于 2012-12-10 13:14

这是:简单模式代码

<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>

这是使用BR 换行代码:

<script>
            KindEditor.ready(function(K) {
                var editor;
                K('select[name=newlineTag]').change(function() {
                    if (editor) {
                        editor.remove();
                        editor = null;
                    }
                    editor = K.create('textarea[name="content"]', {
                        newlineTag : this.value
                    });
                });
                K('select[name=newlineTag]').change();
            });
        </script>
<select name="newlineTag">
                    <option value="br">BR换行</option>
                    <option value="p">P换行</option>
                </select>


我现在想在简单模式直接默认为BR换行。如何整合二个JS.

DZCMS的主页 DZCMS | 初学一级 | 园豆:5
提问于:2012-12-10 12:21
< >
分享
最佳答案
0
create里加个newlineTag配置:
K.create('textarea[name="content"]', {
newlineTag:"br",
resizeType : 1,
....
收获园豆:5
向往-SONG | 老鸟四级 |园豆:4853 | 2012-12-10 12:30
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册