By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,190 Members | 1,056 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,190 IT Pros & Developers. It's quick & easy.

position image based on document position

P: n/a
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 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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';
}

Jan 13 '06 #2

P: n/a
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 '06 #3

P: n/a
VK

ed***********@pt.lu 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.

Jan 14 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.