How can I prevent the user from being able to resize an image in designMode? (disable the handles when image is clicked)
This works fine for Firefox:
document.execCommand("enableObjectResizing", false, false);
For IE i've used:
image.attachEvent("onresizestart", function(e) { e.returnValue = false; }, false);
Say you turn contentEditable on like this:
document.body.contentEditable = true;
All you have to do is turn it off for all (or some) images.
var imgs = document.getElementsByTagName("IMG");
for (var i = 0; i < imgs.length; ++i) {
imgs[i].contentEditable = false;
}
I think you'll find this much more acceptable. Seems to work in Firefox but I'm not sure about other browsers:
document.execCommand("enableObjectResizing", false, false);
It leaves the drag and drop ability intact.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With