PDA

View Full Version : Image placement


rah111
06-27-2002, 01:44 PM
Hi all.

I have been playing with including images I've created within tables to produce an onMouseOver effect for menu options rather than a standard link.

It works ok but not perfectly, which raises two questions.

1. Is there a minimum height for a table row? It doesn't seem to matter what I define the height to be below a certain value.

2. Can I "place" an image wherever I want to on the screen or does it simply render itself at the point in the HTML at which I introduce it? I would like, ideally, to position it using something like I would in normally object-oriented programming. That is, something like:

image.left.value = 90
image.top.value = 50

Is this possible using JavaScript within HTML pages?

Thanks in advance.

Russell.

ACJavascript
06-27-2002, 04:55 PM
Well to position an image like that you could do this.

<img src="imageurl.gif" style="position:absolute;top:90;left:100;">

whackaxe
06-27-2002, 05:45 PM
to reposition it using javascript, you use this

document.imageref.style.left = "10px"
document.imageref.style.top = "10px"

i think there might besome cross browser problems with that type of stuff but i'm not sure

rah111
06-28-2002, 12:45 AM
To ACJavascript and whackaxe.

Thank you both very much. That's exactly what I wanted.

Russell.