JS WYSIWYG Editor - Image Alignment...?

E

Edd

Hi,

I have built a basic WYSIWYG HTML editor using Javascript the
ExecCommand commands.

What is fustrating me is that, according to the MSDN site, there is no
way to set the alignment of an image (eg left, right, middle).

This MUST be possible using Javascript...and I have thought about
using the command

document.iEditor.imagename.style.float = "right"

BUT...i don't know how to set the 'imagename' above to the image
currently selected within the editor.

(FYI 'iEditor' is an iFrame with DesignMode set to 'on')

If anyone has any ideas about how to go about doing this, it would be
massively appreciated!!

Thanks
Edd
 
T

Thomas 'PointedEars' Lahn

Edd said:
I have built a basic WYSIWYG HTML editor using Javascript the
ExecCommand commands.

Yet another one ...
What is fustrating me is that, according to the MSDN site,
URL?

there is no way to set the alignment of an image (eg left, right, middle).

M$ is lying again. You only need to assign the "align"
property of an HTMLImageElement object a proper value.
This MUST be possible using Javascript...and I have thought about
using the command

document.iEditor.imagename.style.float = "right"
[...]
(FYI 'iEditor' is an iFrame with DesignMode set to 'on')

Quickhack (see <http://pointedears.de.vu/scripts/test/whatami>):

var oImageStyle = document.frames['iEditor'].images[imagename].style;
oImageStyle.float = "right";
BUT...i don't know how to set the 'imagename' above to the image
currently selected within the editor.

If anyone has any ideas about how to go about doing this, it would be
massively appreciated!!

How much are you going to pay me?


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top