在IE中禁用调整大小控件 [英] Disabling resize controls in IE

查看:171
本文介绍了在IE中禁用调整大小控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Web应用程序,基于TinyMCE(javascript)的HTML wysiwyg编辑器。
在Internet Explorer中使用designMode =on启用内容编辑。

I have a web application, HTML wysiwyg editor based on TinyMCE (javascript). The content editing is enabled in Internet Explorer with designMode="on".

如果我在编辑的内容中放入iframe:

If I put an iframe in the edited content:

这是我作为HTML源编辑的内容。

This is the content I am editing as HTML source.

<iframe src="..."></iframe>
<b>I just added an iframe to my content</b>

iframe将变为可见,但Internet Explorer将为其创建调整大小控件。这意味着我作为用户可以用鼠标调整iframe的大小。

The iframe will become visible however Internet Explorer will create resize controls for it. That means that I, as a user, can resize the iframe with the mouse.

我想禁用它。有人知道是否有可能吗?

I would like to disable that. Does anybody know if it is possible?

推荐答案

有点令人尴尬我以前没想过。

Kind of embarrassing I haven't thought of it before.

解决方案是 - 当然(在javascript中):

The solution is - of course (in javascript):

var comp = doc.getElementById('my_iframe_comp');
comp.oncontrolselect = function() { return false; };

通过在controlselect事件上返回false,传播停止并且调整大小控件不会显示。

By returning false on controlselect event, the propagation stops and the resize controls do not show up.

这篇关于在IE中禁用调整大小控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆