java newbie ?.gif location script

wxdqz

New Member
I want to locate an image on a webpage depending on the date. I think I need to use layers in order to achieve absolute positioning, which the following assumes. Any help (or directions to help) would be appreciated.

When the page is loaded, I want to position an image with absolute coordinates that depend on the date, with no user input.

I have worked out the way to calculate the x and y offsets for the image, and I have java code that gets the date information, but I am too java-illiterate to know how to put the x and y values calculated in the head of the html file into the <div> Layer tag in the body of the html. I suspect I will need an onLoad command in the <body> tag, with a function that passes the values through, or writes a valid <div> for the layer.

I'm out of my depth, but here is my psuedocode.

<head>
<script java yadda yadda>

var xOffset = 0; // initialize
var yOffset = 0; // ditto

var today = getTodayDate;

function locateTheGif( xOffset, yOffset ){
// some mysterious function here
}

xOffset = xMunge(today); // a calculation
yOffset = yMunge(today); // a different calculation

</script>
</head>

<body onload = "locateTheGif()">

<div id="layer1" with absolute location, containing
myGif.gif at location xOffset, yOffset.

</body>
etc..

any suggestions? Thanks.
 
Back
Top