Click to See Complete Forum and Search --> : Numbers over a Gif image


send2me
12-11-2003, 02:40 PM
I was give this script from this site. It is working great. The one problem I am having is that I want the number to be displayed on a image that I created. Is that posible? Also, Is there a way to change the font for the displayed number?

<html><body>
It has been&nbsp;
<script type="text/javascript">
var dt = new Date(2003,0,5); // 5th Jan 2003
var now = new Date();
var nDays = Math.floor((now.getTime() - dt.getTime()) / 86400000);
document.write(nDays);
</script>
&nbsp;days since last problem.
</body></html>

TheBearMay
12-11-2003, 03:23 PM
You could use overlapping DIVs:

<html><body>
<div style="position:absolute;top:0;">
<img src=.....
</div>
<div style="position:absolute;top:10;left:10">
It has been
<script type="text/javascript">
var dt = new Date(2003,0,5); // 5th Jan 2003
var now = new Date();
var nDays = Math.floor((now.getTime() - dt.getTime()) / 86400000);
document.write(nDays);
</script>
days since last problem.
</div>
</body></html>

send2me
12-12-2003, 07:41 AM
you are da man. Just out of curiousity, how come when viewing this in Dreamweaver I have to move the java image further to the left in order for it to line up correctly on the preview? I placed this script into cells

TheBearMay
12-12-2003, 08:01 AM
May have something to do with the cell padding. Glad to see this will work for you.