You are here: irt.org | FAQ | DHTML | Q255 [ previous next ]
<html> <head> <script language="JavaScript"><!-- function pageOffset() { if (document.layers) { document.layers['layerName'].pageX = window.pageXOffset + 10; document.layers['layerName'].pageY = window.pageYOffset + 10; } else if (document.all) { document.all['layerName'].style.posLeft = document.body.scrollLeft + 10; document.all['layerName'].style.posTop = document.body.scrollTop + 10; } setTimeout('pageOffset()',100); } //--></script> </head> <body onLoad="pageOffset()"> <div id="layerName" style="position: relative" left="10" top="10">Watermark</div>
David Faulder writes:
With Netscape Navigator 4.7 under W98 this works, but if the <div> contains anchor tags the image of them behaves (i.e still relative to screen), but the actual link stays relative to the page.