I am making a custom small menu which is most basic. Problem is that I can't
make the first step work for some reason.
I have an image to the left of where would be the layer positioned. This
layer must be 15 pixels to the left of that image.
Since my main page is centered in the browser's window, the pixels to the
left of my image are different for each browser and also depends on how wide
the browser window is.
This is my stupid code that has a function that is called in BODY onload:
<SCRIPT LANGUAGE="JavaS cript">function PosLayer() {
pic=document.ge tElementById("P icture");
layer=document. getElementById( "Layer");
layer.style.lef t=parseInt(pic. style.left) + 15; }</script>Someone said that
image has no ".style.lef t" property, I don't know if it is true.If it is,
how would I go about positioning the layer where I want relative to some
other object?Thank you very much, somehow my books on Java script don't
describe this well. Please advise me, thank you again.
make the first step work for some reason.
I have an image to the left of where would be the layer positioned. This
layer must be 15 pixels to the left of that image.
Since my main page is centered in the browser's window, the pixels to the
left of my image are different for each browser and also depends on how wide
the browser window is.
This is my stupid code that has a function that is called in BODY onload:
<SCRIPT LANGUAGE="JavaS cript">function PosLayer() {
pic=document.ge tElementById("P icture");
layer=document. getElementById( "Layer");
layer.style.lef t=parseInt(pic. style.left) + 15; }</script>Someone said that
image has no ".style.lef t" property, I don't know if it is true.If it is,
how would I go about positioning the layer where I want relative to some
other object?Thank you very much, somehow my books on Java script don't
describe this well. Please advise me, thank you again.
Comment