SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard holmescreek's Avatar
    Join Date
    Mar 2001
    Location
    Northwest Florida
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Right align an image using document.execCommand("InsertImage".. ???

    I'm using some javascript to insert an image into a layer. Below is the command to insert the image. Is it possibly to specify that the image be right aligned when inserted?


    window.opener.document.execCommand("InsertImage",false,ImageName);

  2. #2
    SitePoint Wizard holmescreek's Avatar
    Join Date
    Mar 2001
    Location
    Northwest Florida
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Found a solution, but another problem came up. Help??

    for reference :

    window.opener.foo.focus();

    window.opener.document.execCommand("InsertImage",false,ImageName);
    window.opener.foo.focus();
    self.close();


    window.opener.document.execCommand("InsertImage",true,ImageName);
    window.opener.foo.focus();
    self.close();


    The first call to execCommand actually inserts the image automatically into the parent windows <div> layer. The second call pops up an image properties box. When you change the property, such as alignment, and press ok it adjusts the image that was uploaded with the first execCommand call.

    It seems that if you only call the execCommand with true set, well, the image dialog box pops up, however it fails to put ImageName (e.g. http://www.whatever.com/myimage.gif) into the input box to specify which file to upload.

    Any suggestions?
    Last edited by holmescreek; May 13, 2002 at 13:15.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •