Disabling resize controls in IE

2019-07-13 04:51发布

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

If I put an iframe in the edited content:

This is the content I am editing as HTML source.

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

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?

1条回答
虎瘦雄心在
2楼-- · 2019-07-13 05:44

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

The solution is - of course (in javascript):

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

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

查看更多
登录 后发表回答