0

RadEditor 版本 7.3.3.0

我正在使用 Telerik 的 radeditor 为创建和修改电子邮件提供编辑选项。

编辑器内容以<tr><td>格式创建。每个 td 里面可以有 div 和其他 dom。

在我们看来,在 Firefox 中进行编辑时,在所见即所得编辑器中为所有 div 提供了调整大小选项。而在其他浏览器中则没有。如何禁用 Firefox 的调整大小选项。

在火狐中:

在此处输入图像描述

在 Chrome 中:

在此处输入图像描述

4

1 回答 1

0

这来自浏览器的富文本编辑引擎,我认为您无法阻止它。

尝试在一个简单的可编辑 iframe 中添加相同的 HTML 来测试它。这是一个简单的页面,您可以使用它:

<body onload="SetEditable()">
<b>Set your original HTML content here:</b><br />
<textarea id="htmlArea" style="width: 783px; height: 189px"></textarea>
<br />
<input type="button" onclick="CreateHtml();return false;" value="Set Content in the IFRAME">
<br />

<b>Editable IFRAME element:</b>
<br />
<iframe
src="javascript:void(0)"
id="editor" style="width: 774px; height: 489px;border: 3px solid red;"></iframe>
<input type="button" onclick="ShowIFRAMEHTML();return false;" value="Show IFRAME HTML">
<br />

<b>HTML Mode of the IFRAME:</b>
<br />
<textarea id="htmlMode" style="width: 783px; height: 313px"></textarea>


    <script type="text/javascript">
var editor1 = document.getElementById("editor"); //reference to the IFRAME element
var htmlArea1 = document.getElementById("htmlArea"); //reference to the HTML area in which we put the content
var htmlMode = document.getElementById("htmlMode"); //reference to the HTML area that displays the IFRAME content
var oDocument = editor1.contentWindow.document;

var sMarkup = "<html><head><title>New Document</title></head>" + 
              "<body contenteditable=true style='overflow:scroll;margin:0px;padding:0px;height:100%'>" + 
              "&nbsp;</body></html>";

function SetEditable()
{
    oDocument.open();
    oDocument.write(sMarkup);
    oDocument.close();      
    oDocument["designMode"] = "on";     
}
function CreateHtml()
{
    oDocument.body.innerHTML = htmlArea1.value;
    htmlMode.value = oDocument.body.innerHTML;
}
function ShowIFRAMEHTML()
{
    alert(oDocument.body.innerHTML);
}

</script>

于 2014-01-07T13:56:09.663 回答