首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

暗藏编辑器ueditor

2013-08-04 
隐藏编辑器ueditor有用过百度ueditor编辑器的帮忙看下正常编辑器在一个页面有2个编辑器,有时要显示一个编

隐藏编辑器ueditor
有用过百度ueditor编辑器的帮忙看下

正常编辑器
暗藏编辑器ueditor

在一个页面有2个编辑器,有时要显示一个编辑器,另一个隐藏,在.aspx页面判断,不符合要求不显示



求解决方法,怎么隐藏编辑器暗藏编辑器ueditor
[解决办法]
你代码里做了判断,但是你在js中实例化一个editor的时候也要做相应判断,jquery判断的话,比如你要实例化的这个 <script type="text/plain" id="Script1" name="contentRemark"><%=sContentRemark %></script> id="Script1",哪里就这样写:
$(function(){
if($("#Script1").length>0){
var editor = new baidu.editor.ui.Editor();
 editor.render('Script1);
}
});
这样就可以了
[解决办法]
把整个编辑器外层套个大的div 来判断条件隐藏该div
[解决办法]
function LoadEditor() {
            var CMD = '<%=CMD %>';


            if (CMD == "New" 
[解决办法]
 CMD == "Edit") {
                var h = document.getElementById("<%=S_ShortRemark.ClientID%>").clientWidth + 50;
                //编辑器 Cai Add 2013
                UE.getEditor('<%=txtS_Remark.ClientID%>',{
                    //这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
                    toolbars:[
                        ['fullscreen', 'source', '
[解决办法]
', 'undo', 'redo', '
[解决办法]
',
                            'bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch','autotypeset','blockquote', 'pasteplain', '
[解决办法]
', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist','selectall', 'cleardoc', '
[解决办法]
',
                            'rowspacingtop', 'rowspacingbottom','lineheight','
[解决办法]
',
                            'customstyle', 'paragraph', 'fontfamily', 'fontsize', '
[解决办法]
',
                            'directionalityltr', 'directionalityrtl', 'indent', '


[解决办法]
',
                            'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '
[解决办法]
','touppercase','tolowercase','
[解决办法]
',
                            'link', 'unlink', 'anchor', '
[解决办法]
', 'imagenone', 'imageleft', 'imageright','imagecenter', '
[解决办法]
',
                            'insertimage', 'insertvideo','music','attachment','pagebreak','template', '
[解决办法]
',
                            'horizontal', 'spechars', '
[解决办法]
',
                            'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', '
[解决办法]
',
                            'print', 'preview', 'searchreplace','help']
                    ],
                    //focus时自动清空初始化时的内容
                    autoClearinitialContent:false,
                    //关闭字数统计


                    wordCount:false,
                    //关闭elementPath
                    elementPathEnabled:false,
                    //更多其他参数,请参考editor_config.js中的配置项
                    initialFrameWidth: h,
                    initialFrameHeight: 300,
                    initialContent: '',
                    autoFloatEnabled:false,
                    //纵向滚动条
                    autoHeightEnabled:false
                });
            }
        }



设一个变量标识,判断一下就可以了。
百度开源免费编辑器(UEditor)使用方法

热点排行