spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column78


Netscape 6, Part VII: Object-Oriented DOCJSLIB 3.1

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

Programming Page Watermarks

We explained page watermarks in Column 29, DOCJSLIB Version 3.0: Page Watermarks. We create the watermark in the function makeLinkedObject(). We every so often compute its position by the function waterMark(), which we call every 100 milliseconds via DOCJSLIB 3.1's function:


myBrowserAPIObj.doThisCommandEveryIntervalMS
  ("waterMark()", 100);

We use DOCJSLIB 3.1 a lot inside the function waterMark(), to set and get the watermark position on the page. We also compute the highest Z index in DOCJSLIB 3.1 as well as set it to the desired value:

function waterMark(){
    oldWindowWidth= windowWidth;
    oldWindowHeight= windowHeight;
    oldPageScrollLeft= pageScrollLeft;
    oldPageScrollTop= pageScrollTop;
    windowWidth = myBrowserAPIObj.getWindowWidth();
    windowHeight = myBrowserAPIObj.getWindowHeight();
    pageScrollLeft = myBrowserAPIObj.getPageScrollLeft();
    pageScrollTop = myBrowserAPIObj.getPageScrollTop();
    if ((windowHeight != oldWindowHeight)||(windowWidth !=
      oldWindowWidth)||(pageScrollLeft !=
      oldPageScrollLeft)|| (pageScrollTop !=
      oldPageScrollTop)){

      myBrowserAPIObj.setPosFromTop("docjslib", windowHeight
        + pageScrollTop - (imageHeight + bottomSpacer));
      myBrowserAPIObj.setPosFromLeft("docjslib", windowWidth
        + pageScrollLeft - (imageWidth + rightSpacer));
      var topZ = myBrowserAPIObj.findHighestZ();
      myBrowserAPIObj.setZposition("docjslib", topZ);
    }
}

Next: Tic-Tac-Toe, popout elements, and watermarks application listing

http://www.internet.com

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint


Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: February 26, 2001
Revised: February 26, 2001

URL: http://www.webreference.com/js/column78/5.html