position image based on document position

Discussion in 'Javascript' started by edouard.lauer@pt.lu, Jan 13, 2006.

  1. Guest

    Hello,

    i've a table generated by PHP which contains about 300 entries. On each
    row you've a link that is a reference to a picture. I want to show the
    image on the same document based on the position of the row clicked.
    I've a div layer but I do not know how I can do that in javascript to
    reposition the image.
    Please note that I've IE as browser (if that matters).

    Regards,
    Edi
    , Jan 13, 2006
    #1
    1. Advertising

  2. impaler Guest

    retrieve the image and put it in a cell on the same row as the link or
    creata a new row for the image or whatever you would like to display
    it, and make that cell (div etc) invisible and the link should
    hide/show the image.

    divContainingImg.style.display = (divContainingImg.style.display ==
    'none') ? '' : 'none';

    should do it.
    where divContainingImg is the div or cell or whatever contains the
    image. Pass an id to the function and use getElementById or pass simply
    the object etc and the function will do the rest
    eg:

    function showHideImg(id) {
    divContainingImg = document.getElementById(id);
    divContainingImg.style.display = (divContainingImg.style.display ==
    'none') ? '' : 'none';
    }
    impaler, Jan 13, 2006
    #2
    1. Advertising

  3. Guest

    Hello,

    thanks for the answer but this is not what I want to do. I want really
    the image to appear separatly of the table but at the same locate as
    the actual row. How do I do that?
    , Jan 14, 2006
    #3
  4. VK Guest

    wrote:
    > Hello,
    >
    > thanks for the answer but this is not what I want to do. I want really
    > the image to appear separatly of the table but at the same locate as
    > the actual row. How do I do that?


    See at:
    <http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/53548d50037263db/5bd09e43eeb768e9>

    The last post by "VK" contains the code to position popup windows in a
    long table. Just change it for pictures.
    VK, Jan 14, 2006
    #4
    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. Steve Carrow
    Replies:
    0
    Views:
    548
    Steve Carrow
    Jul 28, 2003
  2. Wendy S
    Replies:
    1
    Views:
    6,357
    Darren Davison
    Aug 5, 2003
  3. Mike
    Replies:
    0
    Views:
    8,016
  4. Laszlo Zsolt Nagy
    Replies:
    1
    Views:
    1,320
    Kartic
    Jan 26, 2005
  5. Dan
    Replies:
    3
    Views:
    128
Loading...

Share This Page