Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

table + images question

Status
Not open for further replies.

eyetry

Programmer
Oct 2, 2002
560
US
have a table with 3 cells. the first two have icons while the 3rd is empty. I want to link the icons in cell 1 & 2 to images that will display in cell 3.

How would the code read?

<tr>
<td align="center"><IMG SRC="icon_image1.jpg" ></td>
<td align="center"><IMG SRC="icon_image2.jpg" ></td>
</tr>
<tr>
<td colspan="2" align="center"><image linked to picture here ></td>
</tr>
</table>
 
You mean an image should appeatr in cell 3 when you hover over cell1 or 2?

If that's the case, then you need Javascript. Wrap your image in link tags and use the OnMouseOver event to change the value of an image tag in the third cell.

This f course falls outside the scope fo this forum.

But searching for disjointed Rollovers, or asking in the forum216 will probably help.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
As opposed to hovering I'd like it to be a click. The third cell should be the target, similar to using frames.
 
Still Javascript. Use the OnClick event.

<image src="..." OnClick="document.[red]myimage[/red].src="path/to/otherimage.jpg">

and in your third Cell:

<img src="path/to/defaultimg.jpg" name="[red]myimage[/red]">


----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
No way of doing without JS or ASP etc... ?
 
Nope. HTML is a static language it cannot do scripting actions such as changing images on the fly.

CSS may be able to do it, but I wouldn't guarantee any sort of Cross Browser compatibility.





----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
You can do rollovers with css, but not clicking on the image. See Eric Meyer's pure css popups 2 among other places.

Greg
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. Kierkegaard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top