watermark script

by "susan banta" <sebanta(at)hotmail.com>

 Date:  Wed, 15 Mar 2000 10:28:43 PST
 To:  hwg-basics(at)hwg.org
  todo: View Thread, Original


                           I recently got this script from Javascripts.com 
and I'm trying to edit it,
                           as well as learn it. It's similar to the 
Geocities floating watermark. The thing is,
                           I can't get my image to position itself on the 
lefthand side instead of the right.
                           Odd I know. Here's the script:


                           In the <Head> tag:

                           <SCRIPT LANGUAGE="JavaScript">
                           function setVariables() {
                           imgwidth=232; // logo width, in pixels
                           imgheight=233; // logo height, in pixels
                           if (navigator.appName == "Netscape") {
                           horz=".left";
                           vert=".top";
                           docStyle="document.";
                           styleDoc="";
                           innerW="window.innerWidth";
                           innerH="window.innerHeight";
                           offsetX="window.pageXOffset";
                           offsetY="window.pageYOffset";
                           }
                           else {
                           horz=".pixelLeft";
                           vert=".pixelTop";
                           docStyle="";
                           styleDoc=".style";
                           innerW="document.body.clientWidth";
                           innerH="document.body.clientHeight";
                           offsetX="document.body.scrollLeft";
                           offsetY="document.body.scrollTop";
                           }
                           }
                           function checkLocation() {
                           objectXY="person";
                           var availableX=eval(innerW);
                           var availableY=eval(innerH);
                           var currentX=eval(offsetX);
                           var currentY=eval(offsetY);
                           x=availableX-(imgwidth+30)+currentX;
                           y=availableY-(imgheight+20)+currentY;
                           evalMove();
                           setTimeout("checkLocation()",10);
                           }
                           function evalMove() {
                           eval(docStyle + objectXY + styleDoc + horz + "=" 
+ x);
                           eval(docStyle + objectXY + styleDoc + vert + "=" 
+ y);
                           }
                           // End -->
                           </SCRIPT>



                           In the <Body> tag:

                           <BODY onload="setVariables(); checkLocation();" 
bgcolor="#ffffff"
                           text="#000000">

                           <div id="person" style="position:absolute; 
visibility:show; left:235px;
                           top:-50px; z-index:2">
                           <table width="10" 
bgcolor="#ffffff"><td><center><IMG
                           SRC="#StoreImagePath/images/woman1.gif" border=0 
width="232"
                           height="233" alt=""></center></td>
                           </table>
                           </div>


                           Now I've tried playing with the "left:235px" in 
the <Div> tag but that doesn't
                           change anything for some reason. I've also 
adjusted the "position:absolute"
                           which does change the position, but then the 
image doesn't scroll.

                           Any ideas for me?

                           Thanks for your time,
Susan
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA