开发者

Disable resizing tables in mozilla in design mode [duplicate]

开发者 https://www.devze.com 2022-12-26 02:24 出处:网络
This question already has answers here: 开发者_如何学Go How can I disable _moz_resizing? (2 answers)
This question already has answers here: 开发者_如何学Go How can I disable _moz_resizing? (2 answers) Closed 8 years ago.

Is there a way to remove the attribute '_moz_resizing="true"' added by Firefox from <TABLE> to avoid giving user the possibility to resize table in design mode (when contentEditable=true).


Yes.

document.designMode = "on";
document.execCommand("enableObjectResizing", false, "false");
document.execCommand("enableInlineTableEditing", false, "false");

In Firefox, the resizing controls on a table often appear at the same time as the inline table editing controls, so you probably really want to turn off both of them.

If your editable content is inside an iframe, be aware that changes to the CSS position of the ancestor iframe will reset the effects of these commands.

I have prepared a simplified test page that shows this solution in action.


Working in Firefox4, it seems that the answer (at least for now) is 'no'. The command referenced in Chris's answer doesn't appear to work in Firefox4, and removing the attribute or setting it to false does not remove the resize functionality from the object once it has already been selected.

0

精彩评论

暂无评论...
验证码 换一张
取 消