How can I prevent the user from being able to resize an image in designMode? (disable the handles when image is clicked)
相关问题
- Views base64 encoded blob in HTML with PHP
- How to get the background from multiple images by
- CV2 Image Error: error: (-215:Assertion failed) !s
- Replace image attributes for lazyload plugin on im
- How to display an image represented by three matri
相关文章
- Use savefig in Python with string and iterative in
- Firefox remembering radio buttons incorrectly
- Where does this quality loss on Images come from?
- Specifying image dimensions in HTML vs CSS for pag
- How to insert pictures into each individual bar in
- How do I append metadata to an image in Matlab?
- Img url to dataurl using JavaScript
- Click an image, get coordinates
I think you'll find this much more acceptable. Seems to work in Firefox but I'm not sure about other browsers:
It leaves the drag and drop ability intact.
I cannot comment and vote yet so... according to nmb.ten's answer, you have to use:
But it works only after your content is filled in (I mean if you have to edit some text saved before).
Say you turn contentEditable on like this:
All you have to do is turn it off for all (or some) images.
This works fine for Firefox:
document.execCommand("enableObjectResizing", false, false);
For IE i've used:
image.attachEvent("onresizestart", function(e) { e.returnValue = false; }, false);
Although the question was a long time ago. Every block element (div, img...) will be decorated with handles from FF. Test it:
No handles, no resize etc.
The image can be resized. So you have to explicitly call contenteditable="false" for every block elem you do not want to have handles, as nickf said already for the images.
Even more weird: assign "position:absolute" to any of your elements - even the parent div - and it has handles again.
Well, you cannot remove those resize handlers neither in Firefox nor IE... at least I couldn't find a solution.
At the end I managed that in Firefox by editing some configuration files from FF installation folder and we don't want to do that, right?
Anyway, if you want to disable resizing if images (but resize handlers will still be visible) just add some css style like:
regards, Mihailo