473,394 Members | 1,781 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.

position image based on document position

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
3 2378
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ken Kast | last post by:
Here's my situation. I have a statically positioned table that has an image in a cell. I also have some layers, defined by absolute-positioned DIVs for some animation. Everything works until I...
4
by: Ghyslaine Crespe | last post by:
Hello, In my script, the line document.getElementById(id).style.background-position = "-200px -500px"; fails ! So, how can I change the background-position value ?
4
by: Jay | last post by:
Hi, How can I capture mouse position on Image? I found number of script capturing mouse position of the page. But I could not find anything based on image. What I want to find out is X Y...
1
by: travis_brooks | last post by:
greetings I had a javascript that was reliably telling me the position of an image on a page, and now its not. I was using the script to draw a bounding box that followed the mouse around over...
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
12
by: cewisham | last post by:
I have a menu that pops up different layers as you mouse over. Seems to work OK in IE 6. I position the layers dynamically with javascript because the menu moves when users resize their browser...
2
by: Dale | last post by:
This seems like it should be simple and I am pretty sure I've done similar things a hundred times before but I sure can't seem to get it right this time. I have a GridView with a column of text...
1
by: jayvardhanpatil | last post by:
Hi All, I'm trying to position a dialog at my mouse position in firefox. I have one image control. On mouseover of image I call captureMouse() to get mouse position and after click on image I...
7
by: Paul | last post by:
Hi, I'm trying to find the left and top position of an image in MSIE. In HTML the image is <img border=0 src="image.png" id="myimage" style="position:relative;" / The javascript is ...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.