首页 新闻 搜索 专区 学院

Ueditor ,如何修改使其宽度自适应

1
悬赏园豆:5 [已解决问题] 解决于 2017-09-28 15:48

1、网上说的修改方法:

 修改源码,方法如下:

editor_all.js中,搜索以下行:

editor.container.style.cssText = “z-index:” + editor.options.zIndex + “;width:” + editor.options.initialFrameWidth + “px”;

改为:

editor.container.style.cssText = “z-index:” + editor.options.zIndex + “;”; 

editor_all_min.js中修改方法也是一样的;

 

2、修改虽然能满足了宽度自适应,但是当页面运行时,Ueditor编辑框的工具栏都是可以使用的,就是文本输入框似乎处于锁定状态

3、请求各位大师指点迷津。

    我是用的Ueditor 版本为:Ueditor1_2_5_1-utf8-net

WesternWind的主页 WesternWind | 初学一级 | 园豆:7
提问于:2014-04-13 17:30
< >
分享
最佳答案
0

<script type="text/plain" id="myEditor" class="remarkContext" style="width:100%"></script>

经测试,用Class或Style都可以实现宽度自适应。

收获园豆:5
happydaily | 菜鸟二级 |园豆:291 | 2014-04-13 18:25

大侠,你没看懂我的意思。

 <div id="myEditor"  style="width:100%;"> </div>
                        <script type="text/javascript">
                            var ue = new baidu.editor.ui.Editor(
                                        {
                                            initialContent: "请在这里输入正文......",
                                            autoClearinitialContent: true, //focus时自动清空初始化时的内容
                                            //initialFrameWeight:100%,
                                            initialFrameHeight:350,
                                            textarea: 'editorContent',      //设置提交时编辑器内容的名字

                                            autoFloatEnabled: false,
                                            focus:false,
                                            autoHeightEnabled: false,
                                            sourceEditor: true,
                                            wordCount: false,               //关闭字数统计
                                            elementPathEnabled: false,      //关闭elementPath
                                            maximumWords: 10240
                                        }
                                    );
                              ue.render("myEditor");
                        </script> 

 

     修改虽然能满足了宽度自适应,但是当页面运行时,Ueditor编辑框的工具栏都是可以使用的,就是文本输入框似乎处于锁定状态。

    这个该如何解决?

WesternWind | 园豆:7 (初学一级) | 2014-04-13 19:19

@WesternWind: 你把原始的包里的示例页面打开,看看能不能用,如果可以,说明你的设置出问题了。

happydaily | 园豆:291 (菜鸟二级) | 2014-04-13 19:37

@happydaily: 似乎不行呢 ,亲!

WesternWind | 园豆:7 (初学一级) | 2014-04-19 21:06

@WesternWind: 原始示范包都有问题,那是不是你的浏览器有问题啊?

happydaily | 园豆:291 (菜鸟二级) | 2014-04-19 21:08

@happydaily: 我的页面主要代码如下:

<div class="Wrapper" style="width:100%">

     <div class="Menu"   style="float:left; width:250px;">
         左侧导航菜单
     </div>

     <div class="Contnet" style="float:right; margin:0 0 0 10px;">

           <div  class="Editor"  style="float:left;">
              
                  <div id="TextCnt" style="width:100%"> </div>  
                                    
                    <script type="text/javascript">
                        var ue = new baidu.editor.ui.Editor(
                                    {
                                        initialContent: "请在这里输入正文......",
                                        autoClearinitialContent: false, //focus时自动清空初始化时的内容
                                       
                                        initialFrameHeight: 320,

                                        textarea: 'editorContent',

                                        autoFloatEnabled: false,
                                        focus: true,
                                        autoHeightEnabled: false,
                                        sourceEditor: true,
                                        wordCount: false,               //关闭字数统计
                                        elementPathEnabled: false,      //关闭elementPath
                                        maximumWords: 10240
                                    }
                                );
                        ue.render("TextCnt");
                    </script> 

           </div>

           <div  class="tip"  style="float:right;margin:0 0 0 10px; width:200px">
               相关发布提示信息列表
           </div>

     </div>
 </div>

WesternWind | 园豆:7 (初学一级) | 2014-04-19 21:27

@WesternWind: 请到官方网站下载最新的版本及Demo,http://ueditor.baidu.com/website/

happydaily | 园豆:291 (菜鸟二级) | 2014-04-20 09:32
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册