日期:2014-05-17  浏览次数:20469 次

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

正常编辑器


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

<%if (Request.QueryString["type"] == "sel")
              {%>
             <tr>
                <td class="left_title_2" style="width: 300px">
                    编辑器:
                </td>
                <td align="left" class="xq">
                    <script type="text/plain" id="Script1" name="contentRemark"><%=sContentRemark %></script>
                </td>
            </tr>
            <%} %>

编辑器是隐藏了,但是在网页左面,出现一排编辑器的图标


求解决方法,怎么隐藏编辑器

------解决方案--------------------
你代码里做了判断,但是你在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 %>';