473,563 Members | 2,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

position image based on document position


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).


Jan 13 '06 #1
3 2388
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.

divContainingIm g.style.display = (divContainingI mg.style.displa y ==
'none') ? '' : 'none';

should do it.
where divContainingIm g 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

function showHideImg(id) {
divContainingIm g = document.getEle mentById(id);
divContainingIm g.style.display = (divContainingI mg.style.displa y ==
'none') ? '' : 'none';

Jan 13 '06 #2

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

ed***********@p t.lu wrote:

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.c om/group/comp.lang.javas cript/browse_frm/thread/53548d50037263d b/5bd09e43eeb768e 9>

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

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 scroll/resize. Then the image "moves" on the screen but the animation doesn't. The net effect is that their relative positioning changes. I'd like...
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 ?
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 coordinates of mouse position. based on left of the top of my image is 0 0 (X Y coordinates) otherwise, I need to find out position of my image so I...
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 the image, and when you clicked the mouse the x-y position of the image pixel the mouse was over was posted back in the form. I just changed the...
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 window.open function? I would prefer not to create a separate HTML page. So far all I have is the basic var cwin =...
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 window. In the Firefox or Safari browsers the position of the layers is 0,0 no matter what, right off the bat. Top left corner. Can any one tell me...
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 boxes. If I want to position an image over the GridView just below, for instance, the textbox in row 4 of the GridView. I don't care that it covers...
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 need to show the dialog with its topleft corner exactly from my mousepointer (On image) I did following work around It goes well with IE
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 ///////
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.