Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript (CKEDITOR)Internet Explorer删除调整大小处理程序_Javascript_Internet Explorer_Resize_Ckeditor - Fatal编程技术网

Javascript (CKEDITOR)Internet Explorer删除调整大小处理程序

Javascript (CKEDITOR)Internet Explorer删除调整大小处理程序,javascript,internet-explorer,resize,ckeditor,Javascript,Internet Explorer,Resize,Ckeditor,我的问题是,在internet explorer上,编辑器中的每个div都会显示一个调整大小框。。此框不适用于Mozilla Firefox。如何删除此调整大小框/调整大小处理程序,并将元素直接集中在键入或选择上 实际上我需要这个:但它也需要移除这个奇怪的盒子。如果不是删除,我需要单击两次,Ckeditor右键单击菜单失败 部分解 此url提供了部分anwser 它不是来自CKEDITOR,而是来自html5/javascript/ie 这是一个临时修复,右键单击菜单工作正常,再次

我的问题是,在internet explorer上,编辑器中的每个div都会显示一个调整大小框。。此框不适用于Mozilla Firefox。如何删除此调整大小框/调整大小处理程序,并将元素直接集中在键入或选择上

实际上我需要这个:但它也需要移除这个奇怪的盒子。如果不是删除,我需要单击两次,Ckeditor右键单击菜单失败

部分解 此url提供了部分anwser

它不是来自CKEDITOR,而是来自html5/javascript/ie 这是一个临时修复,右键单击菜单工作正常,再次

    $("iframe")[0].contentDocument.attachEvent( 'oncontrolselect', function( event )
    {
            event.srcElement.focus();
            return false;
    }); 
要测试/重现错误/问题,请执行以下操作:

<script src="http://ckeditor.com/apps/ckeditor/4.0.1/ckeditor.js"></script> 
<div id="testEditor">test text<div style="min-height:200px;"> test div</div></div> 
<script>CKEDITOR.replace("testEditor");</script>

测试文字测试组
CKEDITOR.替换(“测试员”);

注意:您需要单击div元素以查看该框。

看起来IE会自动在具有定义尺寸的可编辑元素上添加调整大小手柄。如果去掉最小高度,控制柄将消失

<div contenteditable="true">
    <!-- IE9 displays resize handles around this div because
         its height is defined. -->
    <div style="height: 100px">test</div>
</div>

<div contenteditable="true">
    <!-- No resize handles here because size is auto. -->
    <div>test</div>
</div>

<div>
    <!-- Obviously no handles here either because content is
         not editable. -->
    <div style="height: 100px">test</div>
</div>

测试
测试
测试

当可编辑元素包含在不可编辑元素中时,IE不显示框:

<div contenteditable="false">
    <div contenteditable="true">
       . . .
    </div>
</div>

请注意,此解决方案在用户内容周围包装了一个div,这可能不是最好的。您可以在HTML模式下看到具有contenteditable属性的div。

在我的例子中,在所见即所得编辑器中删除IE11中的调整大小处理程序时遇到问题。我还回顾了许多有关Stackoverflow的主题。原因是我在p段的样式中有属性宽度:705px。当我删除此属性时,该死的调整大小处理程序消失了

看,这是一个类似的问题。似乎设置了属性_cke_resizeable。我正试图移除它,但还没有找到方法?这与body元素Ouadie无关,我对每个块样式元素都有这个问题。@spons如果我没记错的话,只要div设置了
hasLayout
属性,这个问题就会出现(因为您已经发现它是由不同的css属性引起的:)。只有在删除css属性(该属性是此框的原因)时,才能消除此问题。我敢肯定,当IE处于兼容模式时,新的IE会显示这个。但是如果它看起来不能用javascript删除,我知道这就解决了问题。但这并不是解决我问题的办法。因为我不能去掉高度。。我不能控制他们。如果定义了高度,我需要删除处理程序。最后,我定义了一个css来覆盖导致问题的所有css。tnx的反馈。有点遗憾的是它不可移动
editor.on('mode', function (evt) {
   //-- in system mode return, editor has no document here
   if (!evt.editor.document) return false;

   //-- get the body of the document in the cdeditor iframe
   var $editorDocumentBody = $(evt.editor.document.getBody().$);

   //-- if ie hasLayout property, wrapper needed to avoid resize borders
   var documentStyle = $editorDocumentBody[0].currentStyle;
   if (typeof documentStyle.hasLayout != 'undefined' && documentStyle.hasLayout){

      //-- check if wrapper div already exists
      var $insertedElement = $editorDocumentBody.find('div[contenteditable="true"]');

      //-- if not, create wrapper, append body content to it, append to body
      if (!$insertedElement.length) {
         $insertedElement = $('<div/>', {
            contenteditable: 'true'
         }).append($editorDocumentBody.contents()).appendTo($editorDocumentBody);
      };

      //-- set the contenteditable attributes
      $editorDocumentBody.attr('contenteditable', 'false');
      $insertedElement.attr('contenteditable', 'true');
   };
}
config.allowedContent = 
   'span p a img hr h6 h5 h4 h3 h2 h1 th td tr div;*[contenteditable]';