Hi,

yeah I did see it and have been having a play around trying to get the
browsers to make a selection however Mozilla and Netscape says it has no
properties and IE says the object is null, I have two buttons at the bottom
one for right alignment and the other for left alignment, is the problem I'm
having because I'm removing the focus ( although I can see that the image
does stay selected in the editor window ) when I click on the button ? ?
can't remember where I saw the reference about the focus issue, so I'm not
sure if it does apply here

Anyway thanks for all your help on this

"Daniel Fournier" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Mark McNally wrote:
> > Cheers mate thats got me going in the right direction now, all I need to
> > know now is, how do I set the ID for the image when the tag is inserted
by
> > midas ? ?
> >
> > Or alternatively can I "Select" the image and set its Attributes using
DOM ?
> > ? been trying to play around with this one n jus keep being told, that
the
> > object doesn't support this property
> >
> > Hi Mark,
>
> You're wright, Midas doesn't insert an ID attribute.
> What you should do instead is, after inserting your image, select the
> image, then retreive the selection and its range object the out of the
> range get the image element. You can now set the align attribute of this
> image element.
>
> See also my previous answer to Fabrice Esti�venart in this mailing-list
> to know how to get the range object.
>
> var midasWindow =
document.getElementById('editor_widget_ID').contentWindow;
> var midasDocumentBody = midasWindow.contentDocument.body;
> var range = midasWindow.getSelection().getRangeAt(0);
> var imgElement = range.selectNode(midasDocumentBody);
> imgElement.setAttribute('align', 'center');
>
> Cheers,
>
> Daniel
>



Reply via email to