473,394 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

JS WYSIWYG Editor - Image Alignment...?

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
Jul 20 '05 #1
2 2475
In article <dd*************************@posting.google.com> , ma**@eddread.co.uk
(Edd) writes:
I have built a basic WYSIWYG HTML editor using Javascript the
ExecCommand commands.
You have built an IE-only HTML Editor.
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.


That depends on how you are invoking the attempt to align it. If I have an
image and want to align it, what steps do I have to take? Select the image,
then click a button? If so, when I make a selection, keep a global variable
that tracks what is currently selected and then act on it.

Of course, you would have to ensure that when I try to align an image, that I
actually have an image selected.

document.iEditor.images[imageName].style.float
and pass imageName as a parameter to it.

function setImageAlign(imageName,imgAlignment){
document.iEditor.images[imageName].style.float = imgAlignment;
}
--
Randy
Jul 20 '05 #2
Edd wrote:
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.
<computer> Please restate your request. </computer>
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
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Christopher Brandsdal | last post by:
Hi! I have a anoying problem with my editor! What i want to do is make a popup that holds a string for the "hyperlink" window... I have a popup to do this before, and it works perfecty, but in...
6
by: lb | last post by:
Hi I'm looking for a wysiwyg XSTL editor, that actually is wysiwyg. So far every product I have tried out seems to have the idea that wysiwyg is just showing the result of an XML - XSL...
3
by: Mel Smith | last post by:
HI Friends, I'm a newbie at html writing but am a computer programmer and use a great editor (The Semware Editor - TSE) for all my coding -- even building my own first web pages. I'd like...
5
by: Arsalan | last post by:
How do they make WYSIWYG editor in the browser ? I've seen couple of website using them, but how do they make a WYSIWYG editor in the browser ?
12
by: Michael Peters | last post by:
für einen Enduser, der kein HTML kann und nur die Contents auf statischen Seiten ändern will, brauche ich einen einfach zu bedienenden WYSIWYG-Editor. Wäre dankbar für Empfehlungen! -m
4
by: David Lozzi | last post by:
Howdy, I'm using a WYSIWYG editor called TinyMCE. When I edit some text and then save it back to my SQL server using a SQLCommand, all HTML characters are changed to HTML code, i.e. &gt;strong&lt;...
5
by: DaveC | last post by:
I need some sage advice. For years I have been using a HTML editor (HomeSite 3) to produce crude web sites, mostly travelogs with text and a few clickable thumbnails leading to larger images. ...
27
by: prt7u | last post by:
Howdy, I've started back afte a very long time of working with web pages for an organization that I am affiliated with (personally not professionally). Seeing that technology has advanced a lot...
5
by: DavidPr | last post by:
Can anyone recommend a good WYSIWYG editor that I can use on my website? I need one that will allow a user to browse his computer for a image and upload it. It should also make a thumbnail of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.