designMode on an iframe - relocating images in the dom and keeping their focus

Discussion in 'Javascript' started by oopaevah@yahoo.co.uk, Jan 1, 2007.

  1. Guest

    I'm using designMode on an iframe to create a simple html editor, based
    on widgEdit from www.themaninblue.com.

    I've added toolbar buttons that let you nudge an image up and down the
    dom tree. You click on an image in the design view and then press the
    buttons to move the image up or down through the paragraphs. Behind the
    scenes when the button is pressed I create a duplicate of the image
    node, delete it from where it is and locate the previous or next block
    level element and append the duplicated image to that new parent node.

    This works ok and the image moves up or down as you'd expect.

    The problem is that I want to give the new image focus once it has been
    relocated. In firefox the focus indicators remain in the old position
    where the image used to be. It's selecting the image which is no longer
    there, this is wrong. So when I press the "move image upwards" button a
    second time, the newly positioned image isn't in focus and nothing
    happens, you have to manually refocus on the image again (by clicking
    on it) once it has been moved.

    In IE the focus indicators correctly vanish.

    By "focus indicators" I mean the 8 draggable nodes that appear around
    the image so that it can be resized.

    In both browsers I can't give the newly positioned image focus. After
    the button has been pressed I want the newly positioned image to have
    the "focus indicators". The idea is that the user can keep pressing the
    nudge up/down buttons to move the image to wherever they want it to be.

    I have tried oImage.focus(), oImage.click().. Nothing seems to work.

    Can anybody tell me how to do this?

    I can put an example online if you want.
     
    , Jan 1, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    515
  2. Pilu
    Replies:
    0
    Views:
    117
  3. Jay  Xx
    Replies:
    4
    Views:
    121
    Martin Honnen
    Mar 12, 2005
  4. Replies:
    0
    Views:
    125
  5. Sammy
    Replies:
    0
    Views:
    327
    Sammy
    Jan 20, 2006
Loading...

Share This Page